diff options
| author | Tero Kontkanen <tero.kontkanen@granitedevices.fi> | 2017-08-19 16:22:30 +0300 |
|---|---|---|
| committer | Tero Kontkanen <tero.kontkanen@granitedevices.fi> | 2017-08-19 16:35:41 +0300 |
| commit | d78fb3d4aac4ed7c28311a69ae86ffb88d03b972 (patch) | |
| tree | 436950b4d6b2e108514302720ee2d9de200e5b01 /simplemotion.c | |
| parent | 5d21340928cd46b3cb97cae0b9c707a71ef9ced0 (diff) | |
| download | SimpleMotionV2-d78fb3d4aac4ed7c28311a69ae86ffb88d03b972.tar.gz SimpleMotionV2-d78fb3d4aac4ed7c28311a69ae86ffb88d03b972.zip | |
FTDI D2XX driver work in progress, works
Diffstat (limited to 'simplemotion.c')
| -rw-r--r-- | simplemotion.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/simplemotion.c b/simplemotion.c index 58627cb..30220cf 100644 --- a/simplemotion.c +++ b/simplemotion.c @@ -73,17 +73,18 @@ void smDebug( smbus handle, smVerbosityLevel verbositylevel, char *format, ...) va_list fmtargs;
char buffer[1024];
-
- //check if bus handle is valid & opened
- if(smIsHandleOpen(handle)==smfalse) return;
-
if(smDebugOut!=NULL && verbositylevel <= smDebugThreshold )
{
va_start(fmtargs,format);
vsnprintf(buffer,sizeof(buffer)-1,format,fmtargs);
va_end(fmtargs);
if(handle>=0)
- fprintf(smDebugOut,"%s: %s",smBus[handle].busDeviceName, buffer);
+ {
+ if(smIsHandleOpen(handle)==smtrue)
+ {
+ fprintf(smDebugOut,"%s: %s",smBus[handle].busDeviceName, buffer);
+ }
+ }
else
fprintf(smDebugOut,"SMLib: %s",buffer);//no handle given
}
|
