]> rtime.felk.cvut.cz Git - CanFestival-3.git/blobdiff - include/objdictdef.h
Changed OD size from UNS8 to UNS32, and repercuted change to PDO and SDO. Thanks...
[CanFestival-3.git] / include / objdictdef.h
index e76907fdfb8fb714bcb75b1e8b1e9e64611e7195..60948b85a7526cc7cc6e6c665619c20e71e967f2 100644 (file)
@@ -85,7 +85,7 @@ typedef struct td_subindex
 {
     UNS8                    bAccessType;
     UNS8                    bDataType; /* Defines of what datatype the entry is */
-    UNS                   size;      /* The size (in Byte) of the variable */
+    UNS32                   size;      /* The size (in Byte) of the variable */
     void*                   pObject;   /* This is the pointer of the Variable */
 } subindex;
 
@@ -118,7 +118,7 @@ typedef const indextable * (*scanIndexOD_t)(UNS16 wIndex, UNS32 * errorCode, ODC
 /************************** MACROS *********************************/
 
 /* CANopen usefull helpers */
-#define GET_NODE_ID(m)         (m.cob_id & 0x7f)
-#define GET_FUNCTION_CODE(m)     (m.cob_id >> 7)
+#define GET_NODE_ID(m)         (UNS16_LE(m.cob_id) & 0x7f)
+#define GET_FUNCTION_CODE(m)   (UNS16_LE(m.cob_id) >> 7)
 
 #endif /* __objdictdef_h__ */