eeprom_stm32: add stm32f4 series support

based on code by @yulei in https://github.com/qmk/qmk_firmware/pull/7803
This commit is contained in:
Ilya Zhuravlev
2021-07-11 19:20:41 -04:00
parent ae1d581ca7
commit 1ba3126ae4
5 changed files with 76 additions and 25 deletions

View File

@ -56,8 +56,12 @@ void EEPROM_Init(void) {
static void eeprom_clear(void) {
FLASH_Unlock();
#if defined(EEPROM_EMU_STM32F4)
FLASH_ErasePage(FEE_SECTOR_ID);
#else
for (uint32_t erase_address = SNAPSHOT_START; erase_address < WRITELOG_END; erase_address += FEE_PAGE_SIZE)
FLASH_ErasePage(erase_address);
#endif
FLASH_Lock();