stm32:L4:flash: support erasing pages on bank 2
Reviewed-by: Karl Palsson <karlp@tweak.net.au> (fixed code style)
This commit is contained in:
parent
d44ffe8c0b
commit
6fc1ff225e
@ -160,6 +160,9 @@ void flash_erase_page(uint32_t page)
|
||||
|
||||
/* page and bank are contiguous bits */
|
||||
FLASH_CR &= ~((FLASH_CR_PNB_MASK << FLASH_CR_PNB_SHIFT) | FLASH_CR_BKER);
|
||||
if (page > 255) {
|
||||
FLASH_CR |= FLASH_CR_BKER;
|
||||
}
|
||||
FLASH_CR |= page << FLASH_CR_PNB_SHIFT;
|
||||
FLASH_CR |= FLASH_CR_PER;
|
||||
FLASH_CR |= FLASH_CR_START;
|
||||
|
Loading…
x
Reference in New Issue
Block a user