File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
libraries/mbed/targets/hal/TARGET_STM/TARGET_NUCLEO_F030R8 Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 32
32
33
33
void sleep (void )
34
34
{
35
+ // Disable us_ticker update interrupt
36
+ TIM_ITConfig (TIM1 , TIM_IT_Update , DISABLE );
37
+
35
38
SCB -> SCR = 0 ; // Normal sleep mode for ARM core
36
39
__WFI ();
40
+
41
+ // Re-ensable us_ticker update interrupt
42
+ TIM_ITConfig (TIM1 , TIM_IT_Update , ENABLE );
37
43
}
38
44
45
+ // MCU STOP mode
46
+ // Wake-up with external interrupt
39
47
void deepsleep (void )
40
- {
48
+ {
41
49
// Enable PWR clock
42
50
RCC_APB1PeriphClockCmd (RCC_APB1Periph_PWR , ENABLE );
43
51
44
52
// Request to enter STOP mode with regulator in low power mode
45
- PWR_EnterSTOPMode (PWR_Regulator_LowPower , PWR_STOPEntry_WFI );
53
+ PWR_EnterSTOPMode (PWR_Regulator_LowPower , PWR_STOPEntry_WFI );
46
54
}
You can’t perform that action at this time.
0 commit comments