Call HAL lib inside Call back
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-06-01 2: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
Labels:
- Labels:
-
STM32Cube MCU Packages
-
TIM
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-06-01 4:55 AM
It is. Look at (debug step) the implementation.
hth
KnarfB
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-06-01 8:38 AM
