From fd6dbdf188b0bc37ad672e718c0d88da4f64161f Mon Sep 17 00:00:00 2001 From: Andreas Karlsson Date: Sat, 25 Feb 2023 10:35:42 +0100 Subject: [PATCH] Don't force packing of objd/objectlist stucts objd/objectlist don't map to any EtheCAT protocol headers, hence they don't need to be packed. Pro and conns for packing or not. Packed structs give optimized smaller size of ObjectDictionary. Unpacked structs give optimized performance when iterating and accessing processdata pointers. Unpacked give more toolchain portable code. --- soes/esc_coe.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/soes/esc_coe.h b/soes/esc_coe.h index 17aee0c..109cb5f 100644 --- a/soes/esc_coe.h +++ b/soes/esc_coe.h @@ -13,8 +13,8 @@ #include -CC_PACKED_BEGIN -typedef struct CC_PACKED + +typedef struct { uint16_t subindex; uint16_t datatype; @@ -24,10 +24,9 @@ typedef struct CC_PACKED uint32_t value; void *data; } _objd; -CC_PACKED_END -CC_PACKED_BEGIN -typedef struct CC_PACKED + +typedef struct { uint16_t index; uint16_t objtype; @@ -36,7 +35,7 @@ typedef struct CC_PACKED const char *name; const _objd *objdesc; } _objectlist; -CC_PACKED_END + typedef struct {