SPRADL4 January 2025 F29H850TU , F29H859TU-Q1
The EEPROM_Erase_Inactive_Unit() function provides functionality for erasing the inactive sector(s) used for emulation. At least one entire sector must be erased as partial erase is not supported. Before erasing, you must ensure that stored data is no longer needed/valid. In the Ping Pong implementation, this function is only called when all EEPROM banks and pages in one EEPROM unit are used and data is successfully written to the other EEPROM unit. The function begins by re-calculating the Write/Erase Protection masks for the inactive (full) EEPROM unit, and then calls the Erase_Bank function.
EEPROM_ACTIVE_UNIT ^= 1;
Set_Protection_Masks();
Erase_Bank();
EEPROM_ACTIVE_UNIT ^= 1;
Set_Protection_Masks();