--- a/svghmi/svghmi.c Thu Jun 19 13:13:32 2025 +0200
+++ b/svghmi/svghmi.c Fri Jun 20 11:33:21 2025 +0200
@@ -459,9 +459,11 @@
- uint32_t index = *(uint32_t*)(cursor);
+ uint32_t index; // = *(uint32_t*)(cursor); uint8_t const *valptr = cursor + sizeof(uint32_t);
+ // unaligned access forces memcpy instead of cast + memcpy(&index, cursor, sizeof(uint32_t)); if(index == heartbeat_index)
@@ -536,8 +538,12 @@
- uint32_t index = *(uint32_t*)(cursor);
- uint16_t refresh_period_ms = *(uint32_t*)(cursor + sizeof(uint32_t));
+ uint32_t index; // = *(uint32_t*)(cursor); + uint16_t refresh_period_ms; // = *(uint32_t*)(cursor + sizeof(uint32_t)); + // unaligned access forces memcpy instead of cast + memcpy(&index, cursor, sizeof(uint32_t)); + memcpy(&refresh_period_ms, cursor+sizeof(uint32_t), sizeof(uint16_t)); if(index < HMI_ITEM_COUNT)