diff --git a/cube/User/Inc/eeprom.h b/cube/User/Inc/eeprom.h index 4ad1575..3a6d249 100644 --- a/cube/User/Inc/eeprom.h +++ b/cube/User/Inc/eeprom.h @@ -25,6 +25,7 @@ typedef struct __attribute__((__packed__)) s_deviceStats { } t_deviceStats; static_assert((sizeof(t_deviceStats) <= EEPROM_WRITE_BLOCK_SIZE), "t_deviceStats has illegal size, must be less than or equal 32"); +static_assert((sizeof(t_configBlock) % 32 == 0), "t_configBlock has illegal size, must be dividable by 32"); #define EEPROM_BASE_ADDR 0 diff --git a/cube/User/Inc/sinkStruct.h b/cube/User/Inc/sinkStruct.h index c8fd84b..d2f8f61 100644 --- a/cube/User/Inc/sinkStruct.h +++ b/cube/User/Inc/sinkStruct.h @@ -12,6 +12,7 @@ typedef struct __attribute__((__packed__)) { uint32_t totalRunningHours; uint32_t totalPowercycles; uint32_t totalWatchdogResets; + uint32_t version; uint64_t timestamp; uint32_t frequency[SECONDS_PER_MINUTE]; } t_minuteStruct; diff --git a/cube/User/Src/counter.c b/cube/User/Src/counter.c index 5c90b76..4da9a8d 100644 --- a/cube/User/Src/counter.c +++ b/cube/User/Src/counter.c @@ -47,6 +47,8 @@ void counterMinuteTick(void *handle) { minuteBuffer->s.totalRunningHours = deviceStats->totalRunningHours; minuteBuffer->s.totalPowercycles = deviceStats->totalPowercycles; minuteBuffer->s.totalWatchdogResets = deviceStats->totalWatchdogResets; + minuteBuffer->s.version = strtol(VERSION, NULL, 16); + memset(minuteBuffer->s.deviceId, 0, sizeof(minuteBuffer->s.deviceId)); strcpy(minuteBuffer->s.deviceId, config->deviceId);