flash_lock() must be at beginning

This commit is contained in:
merlokk 2019-01-21 17:38:56 +02:00
parent dffc1833cb
commit 81e58a92f2

View File

@ -29,6 +29,11 @@
#include "log.h" #include "log.h"
#include "device.h" #include "device.h"
static void flash_lock()
{
FLASH->CR |= (1U<<31);
}
static void flash_unlock() static void flash_unlock()
{ {
if (FLASH->CR & FLASH_CR_LOCK) if (FLASH->CR & FLASH_CR_LOCK)
@ -197,8 +202,3 @@ void flash_write_fast(uint32_t addr, uint32_t * data)
__enable_irq(); __enable_irq();
} }
void flash_lock()
{
FLASH->CR |= (1U<<31);
}