]> rtime.felk.cvut.cz Git - CanFestival-3.git/commitdiff
Fixed some endianess problems in states.c and sync.c
authoretisserant <etisserant>
Wed, 23 Apr 2008 12:12:08 +0000 (12:12 +0000)
committeretisserant <etisserant>
Wed, 23 Apr 2008 12:12:08 +0000 (12:12 +0000)
src/states.c
src/sync.c

index 2ab4d7fb8ce96ebd8ece4e341da3f5f00d5574f5..1033d842c423c72a02f4c1d2f2cded8679ade25e 100644 (file)
@@ -256,13 +256,13 @@ void setNodeId(CO_Data* d, UNS8 nodeId)
     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;
     }
   }
 
index edf4daa71f8481b5c45aeb4cfe763cae7f36f793..efea19eb413203859e8552164b63f77afda5ffa2 100644 (file)
@@ -131,7 +131,7 @@ UNS8 sendSYNCMessage(CO_Data* d)
   
   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;