cancel
Showing results for 
Search instead for 
Did you mean: 

How to know which timer triggered the callback

patrickbrataas9
Associate II
Posted on November 05, 2014 at 12:14

How can I check what timer triggered the callback:

void HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef *htim)
{
}

I investigated the htim structure, but did not find anything that can be used to do this.. There should be some ID or a function for checking if htim == htim1 etc.
1 REPLY 1
patrickbrataas9
Associate II
Posted on November 05, 2014 at 13:32

I figured out a way to do it:

switch( (uint32_t) htim->Instance)
{
case TIM1_BASE:
//Code here.
break;
}