rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
hw_layer
ports
at32
at32f4
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
10
bool
mcuCanFlashWhileRunning
() {
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! */
18
void
stm32_standby
() {
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!
31
boardPrepareForStandby
();
32
33
__WFI();
34
}
mcuCanFlashWhileRunning
bool mcuCanFlashWhileRunning()
Definition
mpu_util.cpp:10
stm32_standby
void stm32_standby()
Definition
mpu_util.cpp:18
flash_int.h
pch.h
boardPrepareForStandby
void boardPrepareForStandby()
Definition
stm32_common.cpp:270
Generated on Sat Sep 27 2025 00:10:06 for rusEFI by
1.9.8