aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pcserialport.c1
-rw-r--r--simplemotion.c9
2 files changed, 3 insertions, 7 deletions
diff --git a/pcserialport.c b/pcserialport.c
index ef33aa9..2b44add 100644
--- a/pcserialport.c
+++ b/pcserialport.c
@@ -23,6 +23,7 @@
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
+#include <string.h>
smint32 serialPortOpen(const char * port_device_name, smint32 baudrate_bps)
{
diff --git a/simplemotion.c b/simplemotion.c
index 4ef9b00..9a0b3fb 100644
--- a/simplemotion.c
+++ b/simplemotion.c
@@ -1,3 +1,4 @@
+
//Copyright (c) Granite Devices Oy
#include <stdio.h>
@@ -463,12 +464,6 @@ SM_STATUS smAppendSMCommandToQueue( smbus handle, int smpCmdType,smint32 paramva
SMPayloadCommand16 newcmd;
newcmd.ID=SMPCMD_SETPARAMADDR;
newcmd.param=paramvalue;
-
- // bufput8bit( smBus[handle].recv_rsbuf, smBus[handle].cmd_send_queue_bytes, 5);
- // bufput8bit( smBus[handle].recv_rsbuf, smBus[handle].cmd_send_queue_bytes, 6);
- /*
-FIXME
- ei toimi, menee vaa nollaa*/
bufput8bit( smBus[handle].recv_rsbuf, smBus[handle].cmd_send_queue_bytes++, ((unsigned char*)&newcmd)[1]);
bufput8bit( smBus[handle].recv_rsbuf, smBus[handle].cmd_send_queue_bytes++, ((unsigned char*)&newcmd)[0]);
}
@@ -866,7 +861,7 @@ SM_STATUS smGetBufferClock( const smbus handle, const smaddr targetaddr, smuint1
if(stat!=SM_OK) return recordStatus(handle,stat); //maybe timeouted
if(clock!=NULL)
- *clock=bufget16bit(smBus[handle].recv_rsbuf,0);
+ memcpy(clock,smBus[handle].recv_rsbuf,sizeof(smuint16));
smBus[handle].recv_storepos=0;