fix ee24 off by one

This commit is contained in:
2024-02-25 00:00:37 +01:00
parent fef8a8fb32
commit 2384399d97

View File

@@ -47,7 +47,7 @@ void BSP_EE24_TableMigrate(uint32_t ee_version);
*/
void BSP_EE24_InitTable() {
uint32_t address = 0; // Start at address 0
for (int i = 1; i < __BSP_EE24_PART_MAX__; i++) {
for (int i = 0; i < __BSP_EE24_PART_MAX__; i++) {
if (PartionTable[i].len > 0) {
PartionTable[i].address = address;
address += PartionTable[i].len;
@@ -60,6 +60,7 @@ void BSP_EE24_InitTable() {
* Initializes the EEPROM driver and performs any necessary migrations.
*/
bool BSP_EE24_Init(void) {
BSP_EE24_InitTable();
// Initialize the EE24 driver with the I2C interface and address
bool status = EE24_Init(&hee24,BSP_EE24_I2C,BSP_EE24_ADDRESS);
if(!status) {