Skip to content

Commit ae20d14

Browse files
committed
[NUCLEO_F030R8] Remove timer update interrupt in sleep
1 parent 2663367 commit ae20d14

File tree

1 file changed

+10
-2
lines changed
  • libraries/mbed/targets/hal/TARGET_STM/TARGET_NUCLEO_F030R8

1 file changed

+10
-2
lines changed

libraries/mbed/targets/hal/TARGET_STM/TARGET_NUCLEO_F030R8/sleep.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,23 @@
3232

3333
void sleep(void)
3434
{
35+
// Disable us_ticker update interrupt
36+
TIM_ITConfig(TIM1, TIM_IT_Update, DISABLE);
37+
3538
SCB->SCR = 0; // Normal sleep mode for ARM core
3639
__WFI();
40+
41+
// Re-ensable us_ticker update interrupt
42+
TIM_ITConfig(TIM1, TIM_IT_Update, ENABLE);
3743
}
3844

45+
// MCU STOP mode
46+
// Wake-up with external interrupt
3947
void deepsleep(void)
40-
{
48+
{
4149
// Enable PWR clock
4250
RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE);
4351

4452
// 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);
4654
}

0 commit comments

Comments
 (0)