From f58538ab79b8e4f2593e18ac361cfa367c3fc0a3 Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Tue, 16 Feb 2021 12:09:08 +0100 Subject: [PATCH] rearrange configblock --- cube/User/Inc/config.h | 4 ++-- cube/User/Inc/eeprom.h | 1 - cube/User/Src/config.c | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/cube/User/Inc/config.h b/cube/User/Inc/config.h index c823f27..33a9a83 100644 --- a/cube/User/Inc/config.h +++ b/cube/User/Inc/config.h @@ -4,16 +4,16 @@ #include #include -#define CONFIG_MAGIC 0xdead0007 +#define CONFIG_MAGIC 0xdead0008 typedef struct __attribute__((__packed__)) s_configBlock { uint32_t configMagic; char deviceName[16]; - uint8_t macAddress[6]; char ntpServer[48]; char deviceId[16]; char sharedSecret[SHA256_BLOCK_SIZE]; char sinkServer[48]; + uint8_t macAddress[6]; uint8_t filler[22]; } t_configBlock; diff --git a/cube/User/Inc/eeprom.h b/cube/User/Inc/eeprom.h index 3a6d249..4ad1575 100644 --- a/cube/User/Inc/eeprom.h +++ b/cube/User/Inc/eeprom.h @@ -25,7 +25,6 @@ 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/Src/config.c b/cube/User/Src/config.c index 4395dff..e508e6d 100644 --- a/cube/User/Src/config.c +++ b/cube/User/Src/config.c @@ -10,12 +10,11 @@ t_configBlock defaultConfigBlock = { .configMagic = CONFIG_MAGIC, .deviceName = "MainsCnt", - .macAddress = { 0x00, 0xA0, 0x57, 0x05, 0x3E, 0x0F }, .ntpServer = "0.de.pool.ntp.org", .deviceId = "MainsCnt01", .sharedSecret = "sharedSecretGanzGeheim", .sinkServer = "laborpc", - .filler = { 0 } + .macAddress = { 0x00, 0xA0, 0x57, 0x05, 0x3E, 0x0F } };