1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-24 22:13:52 +01:00

stm32_common/flash_common: properly clear EOP bit

- EOP bit is cleared by writing 1 to the register.
- Guard EOP bit clear for STM32F2, STM32F4, STM32F7
  and STM32L4 EOP bit is only set if EOPIE is enabled.
  Since this is not the case for any platform we exclude
  it when not needed.
This commit is contained in:
francisco 2019-07-03 09:35:53 +02:00
parent 59933d291b
commit 7f675e9ca9

View File

@ -65,8 +65,11 @@ void _wait_for_pending_operations(void)
while (FLASH->SR & FLASH_SR_BSY) {}
}
/* Clear 'end of operation' bit in status register */
if (FLASH->SR & FLASH_SR_EOP) {
FLASH->SR &= ~(FLASH_SR_EOP);
}
/* Clear 'end of operation' bit in status register, for other STM32 boards
this bit is set only if EOPIE is set, which is currently not done */
#if defined(CPU_FAM_STM32F0) || defined(CPU_FAM_STM32F1) || \
defined(CPU_FAM_STM32F3) || defined(CPU_FAM_STM32L0) || \
defined(CPU_FAM_STM32L1)
FLASH->SR |= FLASH_SR_EOP;
#endif
}