Merge pull request #374 from bcostm/fix_F401RE_sleep

[NUCLEO_F401RE] Fix issue with sleep and ST HAL tick timer
pull/379/head
Martin Kojtal 2014-06-26 08:45:12 +01:00
commit f2f5409d12
1 changed files with 8 additions and 0 deletions

View File

@ -36,8 +36,16 @@
static TIM_HandleTypeDef TimMasterHandle;
void sleep(void) {
TimMasterHandle.Instance = TIM5;
// Disable HAL tick interrupt
__HAL_TIM_DISABLE_IT(&TimMasterHandle, TIM_IT_CC2);
// Request to enter SLEEP mode
HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON, PWR_SLEEPENTRY_WFI);
// Enable HAL tick interrupt
__HAL_TIM_ENABLE_IT(&TimMasterHandle, TIM_IT_CC2);
}
void deepsleep(void) {