STM32F103 timer interrupts with HAL_TIM_PWM_PulseFinishedCallback and HAL_TIM_PeriodElapsedCallback does not work as intended
I am trying to do a blink example for testing using built-in LED on bluepill. Unlike regular delay and period interrupts, i want to try a custom-duty blink, in which i want 3s on and 2s off, a total of 5s period.
in main:
HAL_TIM_Base_Start_IT(&htim1);
HAL_TIM_PWM_Start_IT(&htim1, TIM_CHANNEL_1);
callbacks:
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_13, GPIO_PIN_RESET);
}
void HAL_TIM_PWM_PulseFinishedCallback(TIM_HandleTypeDef * htim)
{
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_13, GPIO_PIN_SET);
}
does not work as intended. It just blinks once per period rapidly which is hard to catch. If i disable any of these callbacks, it blinks with period. What am i doing wrong?
