Commit 7e2160f8e5693e3cf22200a721ba204b506f709e

Authored by achemin1
1 parent c00ec28d

Ajout du mode debug

Showing 3 changed files with 8 additions and 3 deletions   Show diff stats
@@ -12,12 +12,12 @@ gcc := "/mnt/c/Program Files (x86)/mingw-w64/i686-8.1.0-posix-dwarf-rt_v6-rev0/m @@ -12,12 +12,12 @@ gcc := "/mnt/c/Program Files (x86)/mingw-w64/i686-8.1.0-posix-dwarf-rt_v6-rev0/m
12 12
13 VERBOSE_THRESHOLD?=3 13 VERBOSE_THRESHOLD?=3
14 14
15 -RELEASE?=0  
16 -ifeq ($(RELEASE), 1) 15 +DEBUG?=0
  16 +ifeq ($(DEBUG), 0)
17 CFLAGS = -W -Wall 17 CFLAGS = -W -Wall
18 VERBOSE_THRESHOLD = 0 18 VERBOSE_THRESHOLD = 0
19 else 19 else
20 - CFLAGS = -W -Wall -g -O0 20 + CFLAGS = -W -Wall -g -O0 -DDEBUG
21 endif 21 endif
22 22
23 23
@@ -10,6 +10,8 @@ Dossier src/ contenant les sources @@ -10,6 +10,8 @@ Dossier src/ contenant les sources
10 Il faut installer les dépendances : libusb avec `apt-get install libusb-1.0` 10 Il faut installer les dépendances : libusb avec `apt-get install libusb-1.0`
11 Pour compiler il faut lancer la commande `make` 11 Pour compiler il faut lancer la commande `make`
12 12
  13 +Pour avoir un niveau haut de verbosité, on peut lancer la commande `make DEBUG=1`
  14 +
13 15
14 ## Utiliser 16 ## Utiliser
15 17
@@ -7,6 +7,9 @@ int main(int argc, char *argv[]){ @@ -7,6 +7,9 @@ int main(int argc, char *argv[]){
7 7
8 libusb_context *context; 8 libusb_context *context;
9 usbinit(&context); 9 usbinit(&context);
  10 + #ifdef DEBUG
  11 + libusb_set_option(context, LIBUSB_OPTION_LOG_LEVEL, LIBUSB_LOG_LEVEL_DEBUG);
  12 + #endif
10 13
11 if(argc>1){ 14 if(argc>1){
12 //command mode 15 //command mode