configuration

This commit is contained in:
Wolfgang Hottgenroth 2020-11-27 16:17:28 +01:00
parent 4e3f086fa0
commit 39ca9d963b
Signed by: wn
GPG Key ID: 6C1E5E531E0D5D7F
2 changed files with 4 additions and 4 deletions

View File

@ -19,6 +19,6 @@ void eepromRead(uint16_t addr, uint8_t *buf, uint8_t len);
void eepromSpiTxCpltCallback(SPI_HandleTypeDef *hspi);
t_deviceStats* getGlobalDeviceStats();
void eepromReadConfigBlock(uint8_t blockNum, t_configBlock *destConfigBlock);
void eepromWriteConfigBlock(uint8_t blockNum, t_configBlock *srcConfigBlock);
#endif /* EEPROM_H_ */

View File

@ -137,9 +137,9 @@ void eepromReadConfigBlock(uint8_t blockNum, t_configBlock *destConfigBlock) {
}
}
void eepromWriteConfigBlock(uint8_t blockNum, t_configBlock *destConfigBlock) {
for (uint8_t i = 0; i < (sizeof(*destConfigBlock) / EEPROM_WRITE_BLOCK_SIZE); i++) {
eepromWrite(BLOCK_ADDR[blockNum] + (i * EEPROM_WRITE_BLOCK_SIZE), ((uint8_t*)destConfigBlock) + (i * EEPROM_WRITE_BLOCK_SIZE), EEPROM_WRITE_BLOCK_SIZE);
void eepromWriteConfigBlock(uint8_t blockNum, t_configBlock *srcConfigBlock) {
for (uint8_t i = 0; i < (sizeof(*srcConfigBlock) / EEPROM_WRITE_BLOCK_SIZE); i++) {
eepromWrite(BLOCK_ADDR[blockNum] + (i * EEPROM_WRITE_BLOCK_SIZE), ((uint8_t*)srcConfigBlock) + (i * EEPROM_WRITE_BLOCK_SIZE), EEPROM_WRITE_BLOCK_SIZE);
}
}