cancel
Showing results for 
Search instead for 
Did you mean: 

HRTIM interrupt callback function

JLope.11
Associate III

I would like use HRTIM timerA interruption event, so I where looking for the weak function to rewrite it but not found it.

I found that I must set compilation flag USE_HAL_HRTIM_REGISTER_CALLBACKS to 1 and make all functions as weak.

 

If I make so strong decision I disturb working that timer?,

what is the way to set the compilation flag using cubeide?

Is this the function that I must rewrite?

 

void HRTIM1_TIMA_IRQHandler(void)
{
	//USER CODE
}

 

or I must do this?:

 

void HRTIM1_TIMA_IRQHandler(void)
{
	//user code
	HAL_HRTIM_IRQHandler(&hhrtim1,HRTIM_TIMERINDEX_TIMER_A);
}

 

 

 

 

 

1 REPLY 1
Sarra.S
ST Employee

Hello @JLope.11, sorry for the delayed answer, 

To set the compilation flag USE_HAL_HRTIM_REGISTER_CALLBACKS to 1 in STM32CubeIDE:

Go to Properties>C/C++ Build>Settings, under the Tool settings tab, go to MCU GCC CompilerPreprocessor or Symbols depending on your version of STM32CubeIDE 

Then add a new symbol USE_HAL_HRTIM_REGISTER_CALLBACKS=1

Regarding the interrupt handler function, you can either use callbacks ( void My_HRTIM_TIMA_Callback(HRTIM_HandleTypeDef *hrtim)) or not (void HRTIM1_TIMA_IRQHandler(void)).

Hope that still helps!

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.