configuration

This commit is contained in:
Wolfgang Hottgenroth 2020-11-27 16:14:34 +01:00
parent eaf658de51
commit 9a7e8ee297
Signed by: wn
GPG Key ID: 6C1E5E531E0D5D7F

View File

@ -133,13 +133,13 @@ void eepromReadConfigBlock(uint8_t blockNum, t_configBlock *destConfigBlock) {
static_assert((sizeof(*destConfigBlock) % EEPROM_WRITE_BLOCK_SIZE == 0), "config block has illegal size, must be dividable by 32");
for (uint8_t i = 0; i < (sizeof(*destConfigBlock) / EEPROM_WRITE_BLOCK_SIZE); i++) {
eepromRead(BLOCK_ADDR[blockNum] + (i * EEPROM_WRITE_BLOCK_SIZE), (uint8_t*) (destConfigBlock + (i * EEPROM_WRITE_BLOCK_SIZE)), EEPROM_WRITE_BLOCK_SIZE);
eepromRead(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 *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);
eepromWrite(BLOCK_ADDR[blockNum] + (i * EEPROM_WRITE_BLOCK_SIZE), ((uint8_t*)destConfigBlock) + (i * EEPROM_WRITE_BLOCK_SIZE), EEPROM_WRITE_BLOCK_SIZE);
}
}