stm32/storage: Add support for internal storage on Cortex-M0 MCUs.

This implements self-triggering of the Flash NVIC interrupt on Cortex-M0
devices, which allows enabling internal storage on those MCUs.

Signed-off-by: Asensio Lorenzo Sempere <asensio.aerospace@gmail.com>
This commit is contained in:
Asensio Lorenzo Sempere 2022-04-18 02:39:09 -05:00 committed by Damien George
parent 7f445e3d39
commit 3587d8e808
1 changed files with 4 additions and 0 deletions

View File

@ -83,7 +83,11 @@ uint32_t storage_get_block_count(void) {
static void storage_systick_callback(uint32_t ticks_ms) {
if (STORAGE_IDLE_TICK(ticks_ms)) {
// Trigger a FLASH IRQ to execute at a lower priority
#if __CORTEX_M == 0
NVIC_SetPendingIRQ(FLASH_IRQn);
#else
NVIC->STIR = FLASH_IRQn;
#endif
}
}