2017-07-19 01:14 AM
Is it possible to manage two interrupt timers for two timer one act base timer and one worked as a counter if yes how to call different elapsed timer. Call back function
2017-07-19 01:05 PM
Hello!!!
I Don't know what your harware is.
The callback function called automaticaly after you start the timer by call HAL_TIM_Base_Start_IT(...)
To distinguish interrupts between different timers you can use some code like this.
HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
if(htim->Instance==TIM2)
{
//Do something .The interrupt is from Timer 2
}
if(htim->Instance==TIM3)
{
//Do something else The interrupt is from Timer 3
}
//...etc
// Don't use 'else' statement because you may lose some 'simultaneous' interrupt from another timer
}
2017-07-21 06:16 AM
thanks it is working
2017-07-21 10:00 AM
M abouhasem wrote:
thanks it is working