Fixed some endianess problems in states.c and sync.c
authoretisserant
Wed, 23 Apr 2008 14:12:08 +0200
changeset 446 f138b759026f
parent 445 666f2cf93f06
child 447 c9d01296d6d9
Fixed some endianess problems in states.c and sync.c
src/states.c
src/sync.c
--- a/src/states.c	Mon Apr 21 16:54:01 2008 +0200
+++ b/src/states.c	Wed Apr 23 14:12:08 2008 +0200
@@ -256,13 +256,13 @@
     if((*(UNS32*)d->objdict[offset].pSubindex[1].pObject == 0x600 + *d->bDeviceNodeId)||(*d->bDeviceNodeId==0xFF)){
       /* cob_id_client = 0x600 + nodeId; */
       UNS32 tmp = 0x600 + nodeId;
-      *(UNS32*)d->objdict[offset].pSubindex[1].pObject = UNS32_LE(tmp);
+      *(UNS32*)d->objdict[offset].pSubindex[1].pObject = tmp;
     }
     /* Adjust COB-ID Server -> Client (tx) only id already set to default value or id not valid (id==0xFF)*/
     if((*(UNS32*)d->objdict[offset].pSubindex[2].pObject == 0x580 + *d->bDeviceNodeId)||(*d->bDeviceNodeId==0xFF)){
       /* cob_id_server = 0x580 + nodeId; */
         UNS32 tmp = 0x580 + nodeId;
-      *(UNS32*)d->objdict[offset].pSubindex[2].pObject = UNS32_LE(tmp);
+      *(UNS32*)d->objdict[offset].pSubindex[2].pObject = tmp;
     }
   }
 
--- a/src/sync.c	Mon Apr 21 16:54:01 2008 +0200
+++ b/src/sync.c	Wed Apr 23 14:12:08 2008 +0200
@@ -131,7 +131,7 @@
   
   MSG_WAR(0x3001, "sendSYNC ", 0);
   
-  m.cob_id = *(UNS16*)d->COB_ID_Sync;
+  m.cob_id = m.cob_id = UNS16_LE(*d->COB_ID_Sync);
   m.rtr = NOT_A_REQUEST;
   m.len = 0;