diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2013-11-26 11:30:08 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2013-11-26 12:01:43 +0100 |
commit | b1da188cedec2b0b0fe6551265a33b2e0c0a087d (patch) | |
tree | ac1da6d13d3f4a232000a4e1b78a300a8acd6f41 /libk8055/main.c | |
parent | 57bebabfc861fd8103f4a1e896ca28e88ddbadfe (diff) | |
download | k8055-b1da188cedec2b0b0fe6551265a33b2e0c0a087d.zip k8055-b1da188cedec2b0b0fe6551265a33b2e0c0a087d.tar.gz |
improve debug level support
lib do not segfault when there is no open device
and sett the desired level when a device is opened
k8055cmd set level to 3 on -debug
Diffstat (limited to 'libk8055/main.c')
-rw-r--r-- | libk8055/main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libk8055/main.c b/libk8055/main.c index 92a37f8..41ba33c 100644 --- a/libk8055/main.c +++ b/libk8055/main.c @@ -157,12 +157,12 @@ int main ( int argc,char* params[] ) { fprintf(stderr,"Could not allocate data for k8055_dev struct.\n"); return ( EXIT_FAILURE ); } + if ( debug ) + k8055_set_debug(dev,3); if ( k8055_open_device( dev, ipid )<0 ) { fprintf(stderr,"Could not open the k8055 (port:%d)\nPlease ensure that the device is correctly connected.\n",ipid ); return ( EXIT_FAILURE ); } else { - if ( debug ) - k8055_set_debug(dev,2); if ( resetcnt1 ) k8055_reset_counter( dev,1 ); if ( resetcnt2 ) |