[NUCLEO_F030R8] Remove timer update interrupt in sleep

pull/158/head
bcostm 2014-02-01 19:15:23 +01:00
parent 2663367dc5
commit ae20d141c5
1 changed files with 10 additions and 2 deletions

View File

@ -32,15 +32,23 @@
void sleep(void)
{
// Disable us_ticker update interrupt
TIM_ITConfig(TIM1, TIM_IT_Update, DISABLE);
SCB->SCR = 0; // Normal sleep mode for ARM core
__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)
{
{
// Enable PWR clock
RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE);
// 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);
}