From 54dc75d63c5f838968abb6eda7233fb4aa390cae Mon Sep 17 00:00:00 2001 From: Vincent Dupont Date: Tue, 24 Jan 2017 15:08:32 +0100 Subject: [PATCH] cpu/stm32f1: fix flashpage driver HSI disabling --- cpu/stm32f1/periph/flashpage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) {} }