mirror of https://github.com/ARMmbed/mbed-os.git
[NUCLEO_F401RE] Fix issue with sleep and ST HAL tick timer
The timer used for the ST HAL tick must be disabled before entering in sleep mode.pull/374/head
parent
e2e0999886
commit
c39de07958
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue