diff --git a/cpu/stm32f1/periph/flashpage.c b/cpu/stm32f1/periph/flashpage.c index ddaade1688..3658999e62 100644 --- a/cpu/stm32f1/periph/flashpage.c +++ b/cpu/stm32f1/periph/flashpage.c @@ -81,7 +81,7 @@ void flashpage_write(int page, void *data) FLASH->CR |= FLASH_CR_LOCK; /* restore the HSI state */ - if (hsi_state) { + if (!hsi_state) { RCC->CR &= ~(RCC_CR_HSION); while (RCC->CR & RCC_CR_HSIRDY) {} }