on-internet
← Community

How to use multiple timer capture Interrupt in stm32

Stack Overflow ·

ı have two capture interrupts from tim1ch1 and tim4ch1, when ı worked with only tim1 ch1, ı could use if (htim->Channel == HAL_TIM_ACTIVE_CHANNEL_1) but what if ı want to use tim4ch1 interrupts at the same time. Can ı use below format? is it correct or not? Can you warn me about it. I will not be able to try it as software that so ı want to ask professions about these kind of topics. void HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef *htim) { if (htim->Channel == HAL_TIM_ACTIVE_CHANNEL_1) { if (htim->Instance == htim1.Instance) { // to do sth } else if (htim->Instance == htim4.Instance) { // to

Comments

Sign in or sign up to comment and upvote.

No comments yet.