device configuration prepared

This commit is contained in:
Wolfgang Hottgenroth 2020-11-30 18:55:40 +01:00
parent 7d03900ada
commit 243c487546
Signed by: wn
GPG Key ID: 6C1E5E531E0D5D7F
2 changed files with 4 additions and 3 deletions

View File

@ -5,7 +5,7 @@
#include <spi.h>
#include <assert.h>
#define CONFIG_MAGIC 0xdead0005
#define CONFIG_MAGIC 0xdead0006
#define DEVICE_MAGIC 0xaffe0000
typedef struct __attribute__((__packed__)) s_configBlock {

View File

@ -108,8 +108,9 @@ void configInit() {
eepromWriteConfigBlock(&defaultConfigBlock);
coloredMsg(LOG_BLUE, false, "cfg ci Default configuration block written to eeprom");
eepromWriteDeviceBlock(0, &defaultDeviceBlock[0]);
eepromWriteDeviceBlock(1, &defaultDeviceBlock[1]);
for (uint8_t i = 0; i < sizeof(defaultConfigBlock) / sizeof(t_deviceBlock); i++) {
eepromWriteDeviceBlock(i, &defaultDeviceBlock[i]);
}
coloredMsg(LOG_BLUE, false, "cfg ci Default device blocks written to eeprom");
coloredMsg(LOG_BLUE, false, "cfg ci Reading configuration block from eeprom again");