stm32g0: Cleaned up stm32g0_flash_lock
This commit is contained in:
parent
f554fbd831
commit
486fb6504c
|
@ -315,9 +315,8 @@ static void stm32g0_flash_unlock(target *t)
|
||||||
|
|
||||||
static void stm32g0_flash_lock(target *t)
|
static void stm32g0_flash_lock(target *t)
|
||||||
{
|
{
|
||||||
uint32_t flash_cr = target_mem_read32(t, FLASH_CR);
|
const uint32_t ctrl = target_mem_read32(t, FLASH_CR) | FLASH_CR_LOCK;
|
||||||
flash_cr |= (uint32_t)FLASH_CR_LOCK;
|
target_mem_write32(t, FLASH_CR, ctrl);
|
||||||
target_mem_write32(t, FLASH_CR, flash_cr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool stm32g0_wait_busy(target *const t)
|
static bool stm32g0_wait_busy(target *const t)
|
||||||
|
|
Loading…
Reference in New Issue