mirror of https://github.com/ARMmbed/mbed-os.git
[NUCLEO_F030R8] Remove timer update interrupt in sleep
parent
2663367dc5
commit
ae20d141c5
|
@ -32,15 +32,23 @@
|
||||||
|
|
||||||
void sleep(void)
|
void sleep(void)
|
||||||
{
|
{
|
||||||
|
// Disable us_ticker update interrupt
|
||||||
|
TIM_ITConfig(TIM1, TIM_IT_Update, DISABLE);
|
||||||
|
|
||||||
SCB->SCR = 0; // Normal sleep mode for ARM core
|
SCB->SCR = 0; // Normal sleep mode for ARM core
|
||||||
__WFI();
|
__WFI();
|
||||||
|
|
||||||
|
// Re-ensable us_ticker update interrupt
|
||||||
|
TIM_ITConfig(TIM1, TIM_IT_Update, ENABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MCU STOP mode
|
||||||
|
// Wake-up with external interrupt
|
||||||
void deepsleep(void)
|
void deepsleep(void)
|
||||||
{
|
{
|
||||||
// Enable PWR clock
|
// Enable PWR clock
|
||||||
RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE);
|
RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE);
|
||||||
|
|
||||||
// Request to enter STOP mode with regulator in low power mode
|
// Request to enter STOP mode with regulator in low power mode
|
||||||
PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI);
|
PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue