Question
Encoder overflow or underflow?
Posted on February 17, 2018 at 16:56
Hello,
I configured the TIMER1 to use like an encoder counter. My question is: How I can detect inside the in the interrupt function if the interrupt was caused by an overflow or underflow in the counter?
void
HAL_TIM_PeriodElapsedCallback(
TIM_HandleTypeDef
*htim)
{
if
(htim == &htim1)
{
HAL_GPIO_TogglePin(Led_Groc_GPIO_Port, Led_Groc_Pin);
}
}
Thanks!!!
