diff options
| author | Oskari Timperi <oskari.timperi@optofidelity.com> | 2017-04-11 13:34:07 +0300 |
|---|---|---|
| committer | Oskari Timperi <oskari.timperi@optofidelity.com> | 2017-04-11 13:36:24 +0300 |
| commit | 91e90823cb19d1490d5223d2835f9064ea566c6f (patch) | |
| tree | f6dc2d0668e771baaf6543e62c2df2f276b36c20 | |
| parent | 6728ffdb6f8253a23dc600a8dc810bbc94fd69ab (diff) | |
| download | SimpleMotionV2-91e90823cb19d1490d5223d2835f9064ea566c6f.tar.gz SimpleMotionV2-91e90823cb19d1490d5223d2835f9064ea566c6f.zip | |
Fix wrong handles being passed to smBDRead in simplemotion.cfix-types
smReceiveErrorHandler and smReceiveReturnPacket passed the smbus handle to
smBDRead while smBDRead expects the smbusdevicehandle. This also corrects the
type of SM_BUS.bdHandle from smint8 to smbusdevicehandle.
| -rw-r--r-- | simplemotion.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/simplemotion.c b/simplemotion.c index 9a0b3fb..606eda0 100644 --- a/simplemotion.c +++ b/simplemotion.c @@ -34,7 +34,7 @@ SM_STATUS smReceiveReturnPacket( smbus bushandle ); typedef struct SM_BUS_
{
- smint8 bdHandle;
+ smbusdevicehandle bdHandle;
smbool opened;
enum RecvState recv_state,recv_state_next;
@@ -420,7 +420,7 @@ SM_STATUS smReceiveErrorHandler( smbus handle, smbool flushrx ) smbool success;
do{
smuint8 rx;
- success=smBDRead(handle,&rx);
+ success=smBDRead(smBus[handle].bdHandle,&rx);
}while(success==smtrue);
}
smResetSM485variables(handle);
@@ -644,7 +644,7 @@ SM_STATUS smReceiveReturnPacket( smbus bushandle ) smuint8 ret;
SM_STATUS stat;
- smbool succ=smBDRead(bushandle,&ret);
+ smbool succ=smBDRead(smBus[bushandle].bdHandle,&ret);
if(succ==smfalse)
{
|
