EDIT :thank you for your answers, by modifying HAL_TIM_OC_Start(&htim3, TIM_CHANNEL_2); by HAL_TIM_OC_Start_IT(&htim3, TIM_CHANNEL_2); and by activating the interrupts HAL_NVIC_EnableIRQ(TIM3_IRQn); my program enters the HAL_TIM_OC_DelayElapsedCallback function.
On the other hand, by wanting to create the RQHandler function,
void TIM3_IRQHandler(void){ HAL_TIM_IRQHandler(&htim3); } I get a first defined here error, I don't know if this function is useful for the rest of my problem:
Now that my program enters the callback function of the output compare, it doesn't seem to compare, I explain myself:
I thought the lines:
if(htim->Channel == HAL_TIM_ACTIVE_CHANNEL_4) if(htim->Channel == HAL_TIM_ACTIVE_CHANNEL_2) were going to check if the output compare of channel 2 or 4 is enabled, and if so, do what's in my condition. But, that's not what happens.
My program always enters the conditions.
I did a test to verify this:
I changed the value of my comparative output from channel 4 to 1500. The period of my timer is 1000, so this compare output should never be triggered. But it still triggers, my program enters the condition : if(htim->Channel == HAL_TIM_ACTIVE_CHANNEL_4) when it should not.
I don't know why, I still feel like I'm forgetting something lol