config write still required

This commit is contained in:
2021-02-16 10:30:55 +01:00
parent 73ac869f26
commit e9b60d4058
2 changed files with 2 additions and 1 deletions

View File

@ -40,6 +40,7 @@ void eepromRead(uint16_t addr, uint8_t *buf, uint8_t len);
void eepromSpiTxCpltCallback(SPI_HandleTypeDef *hspi); void eepromSpiTxCpltCallback(SPI_HandleTypeDef *hspi);
t_deviceStats* getGlobalDeviceStats(); t_deviceStats* getGlobalDeviceStats();
void eepromReadConfigBlock(t_configBlock *destConfigBlock); void eepromReadConfigBlock(t_configBlock *destConfigBlock);
void eepromWriteConfigBlock(t_configBlock *srcConfigBlock);
void eepromHourlyUpdateDeviceStats(void *handle); void eepromHourlyUpdateDeviceStats(void *handle);

View File

@ -130,7 +130,7 @@ void eepromReadConfigBlock(t_configBlock *destConfigBlock) {
} }
} }
static void eepromWriteConfigBlock(t_configBlock *srcConfigBlock) { void eepromWriteConfigBlock(t_configBlock *srcConfigBlock) {
for (uint8_t i = 0; i < (sizeof(*srcConfigBlock) / EEPROM_WRITE_BLOCK_SIZE); i++) { for (uint8_t i = 0; i < (sizeof(*srcConfigBlock) / EEPROM_WRITE_BLOCK_SIZE); i++) {
eepromWrite(CONFIG_BLOCK_ADDR + (i * EEPROM_WRITE_BLOCK_SIZE), ((uint8_t*)srcConfigBlock) + (i * EEPROM_WRITE_BLOCK_SIZE), EEPROM_WRITE_BLOCK_SIZE); eepromWrite(CONFIG_BLOCK_ADDR + (i * EEPROM_WRITE_BLOCK_SIZE), ((uint8_t*)srcConfigBlock) + (i * EEPROM_WRITE_BLOCK_SIZE), EEPROM_WRITE_BLOCK_SIZE);
eepromActiveDelay(EEPROM_AFTER_WRITE_DELAY); eepromActiveDelay(EEPROM_AFTER_WRITE_DELAY);