2022-06-01 02:10 AM
Hello,
Is it Ok to read GPIO pins inside a timer call back as follow:
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef* htim)
{
if (htim == &htim2 ) //15 ms
{
BT1 = HAL_GPIO_ReadPin(GPIOx, Pin_x);
BT2 = HAL_GPIO_ReadPin(GPIOx, Pin_x);
BT3 = HAL_GPIO_ReadPin(GPIOx, Pin_x);
...
}
}
Thank you
2022-06-01 04:55 AM
It is. Look at (debug step) the implementation.
hth
KnarfB
2022-06-01 08:38 AM