STM32L412 Wake from Low Power Sleep when Encoder is turned
Hi, what is the best way to wake from Low Power Sleep when an Encoder is rotated?
I have TIM2 setup in encoder mode and it works when in Low Power Run. I just want to switch back from LP Sleep to LP Run when it's turned. Looking in stm32l4xx_hal_tim.c I have not been able get a solution.
This did not work:
//Wake up from Encoder
void HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef *htim)
{
if (htim->Instance == TIM2)
{
LowPowerSleepToRun();
}
}
I have TIM2 global interrupt set in CubeMX.
I have buttons that do this via EXTI, so the LowPowerSleepToRun function works.
If you can keep the reply to HAL and CubeMX solutions I would appreciate it.
Thanks in advance, Lance.
