Skip to main content
Graduate
April 11, 2024
Solved

HRTIM interrupt callback function

  • April 11, 2024
  • 1 reply
  • 1298 views

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);
}

 

 

 

 

 

    This topic has been closed for replies.
    Best answer by Sarra.S

    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!

     

    1 reply

    Sarra.SAnswer
    ST Employee
    April 24, 2024

    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!