AnsweredAssumed Answered

Function callback on ISR generated by CubeMX

Question asked by elgarbe on Apr 5, 2015
Latest reply on Apr 11, 2015 by elgarbe
Hello, I'm Leonardo, from Argentina. 
I've just started with STM32F4 Nucleo board and I'm trying to use CubeMX for Code generation.
I configure TIM5 and 4 IC channel to generate Interrupt. So I'm studying the generated code and I found this:
void TIM5_IRQHandler(void)
{
  /* USER CODE BEGIN TIM5_IRQn 0 */

  /* USER CODE END TIM5_IRQn 0 */
  HAL_TIM_IRQHandler(&htim5);
  /* USER CODE BEGIN TIM5_IRQn 1 */

  /* USER CODE END TIM5_IRQn 1 */
}

Then I go to HAL_TIM_IRQHandler and I found this:

void HAL_TIM_IRQHandler(TIM_HandleTypeDef *htim)
{
  /* Capture compare 1 event */
  if(__HAL_TIM_GET_FLAG(htim, TIM_FLAG_CC1) != RESET)
  {
    if(__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_CC1) !=RESET)
    {
      {
        __HAL_TIM_CLEAR_IT(htim, TIM_IT_CC1);
        htim->Channel = HAL_TIM_ACTIVE_CHANNEL_1;
        
        /* Input capture event */
        if((htim->Instance->CCMR1 & TIM_CCMR1_CC1S) != 0x00)
        {
          HAL_TIM_IC_CaptureCallback(htim);
        }
        /* Output compare event */
        else
        {
          HAL_TIM_OC_DelayElapsedCallback(htim);
          HAL_TIM_PWM_PulseFinishedCallback(htim);
        }
        htim->Channel = HAL_TIM_ACTIVE_CHANNEL_CLEARED;
      }
    }
  }
  /* Capture compare 2 event */
  if(__HAL_TIM_GET_FLAG(htim, TIM_FLAG_CC2) != RESET)

What is HAL_TIM_IC_CaptureCallback(htim);?
where do I have to put my code?

BR

BTW: The box where I write this message is too small!!!! And I don't see "Insert Code" to get beter format on it.... come on!

Outcomes