diff options
Diffstat (limited to 'libk8055')
-rw-r--r-- | libk8055/k8055.h | 4 | ||||
-rw-r--r-- | libk8055/libk8055.c | 9 | ||||
-rw-r--r-- | libk8055/main.c | 2 |
3 files changed, 8 insertions, 7 deletions
diff --git a/libk8055/k8055.h b/libk8055/k8055.h index 83602a3..d1f8359 100644 --- a/libk8055/k8055.h +++ b/libk8055/k8055.h @@ -59,8 +59,8 @@ extern "C" { int k8055_counter_2( struct k8055_dev* dev ); char* k8055_version( void ); - void k8055_set_debug_on( void ); - void k8055_set_debug_off( void ); + int k8055_set_debug( int status ); + int k8055_get_debug( void ); int k8055_search_devices( void ); int k8055_open_device( struct k8055_dev* dev, int board_address ); diff --git a/libk8055/libk8055.c b/libk8055/libk8055.c index a73312d..917cff0 100644 --- a/libk8055/libk8055.c +++ b/libk8055/libk8055.c @@ -197,12 +197,13 @@ static int k8055_takeover_device( libusb_device_handle* handle, int interface ) return 0; } -void k8055_set_debug_on( void ) { - debug = 1; +int k8055_set_debug( int status ) { + debug = ((status>0) ? 1 : 0 ); + return debug; } -void k8055_set_debug_off( void ) { - debug = 0; +int k8055_get_debug( void ) { + return debug; } char* k8055_version( void ) { diff --git a/libk8055/main.c b/libk8055/main.c index 0fc7f68..f2751d0 100644 --- a/libk8055/main.c +++ b/libk8055/main.c @@ -111,7 +111,7 @@ int read_param( int argc, char* params[] ) { !str2int( params[i]+6,&dbt2 ) ) erreurParam = true; else if ( !strcmp( params[i],"-debug" ) ) { debug = 1; - k8055_set_debug_on(); + k8055_set_debug(1); } else if ( !strcmp( params[i],"-reset1" ) ) resetcnt1 = true; else if ( !strcmp( params[i],"-reset2" ) ) resetcnt2 = true; else if ( !strcmp( params[i],"--help" ) ) { |