rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
mpu_util.cpp
Go to the documentation of this file.
1/**
2 * @file mpu_util.cpp
3 *
4 * @date Nov 3, 2023
5 * @author Andrey Gusakov, (c) 2023
6 */
7#include "pch.h"
8#include "flash_int.h"
9
11 /* TODO: check for actual flash configuration? */
12 /* currently we support only AT32F43X with dual-bank flash, so allow flashing to second bank */
13 /* TODO: Seems AT32 is still freezes even write is happen to second bank, while executing code from first */
14 return true;
15}
16
17/* TODO: fix name! */
19 // Don't get bothered by interrupts
20 __disable_irq();
21
22 /* TODO: validate! */
23#if 0
24 SysTick->CTRL = 0;
25 SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
26 PWR->CR |= PWR_CR_PDDS; // PDDS = use standby mode (not stop mode)
27 PWR->CR |= PWR_CR_CSBF; // Clear standby flag
28#endif
29
30 // Do anything the board wants to prepare for standby mode - enabling wakeup sources!
32
33 __WFI();
34}
bool mcuCanFlashWhileRunning()
Definition mpu_util.cpp:10
void stm32_standby()
Definition mpu_util.cpp:18
void boardPrepareForStandby()