Merge pull request #81 from merlokk/fix_flash_lock
flash_lock() must be at beginning
This commit is contained in:
commit
0634510b92
@ -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);
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user