summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'stmhal/timer.c')
-rw-r--r--stmhal/timer.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/stmhal/timer.c b/stmhal/timer.c
index 7f0a70c5e8..5a574867b6 100644
--- a/stmhal/timer.c
+++ b/stmhal/timer.c
@@ -1302,6 +1302,7 @@ STATIC mp_obj_t pyb_timer_channel_callback(mp_obj_t self_in, mp_obj_t callback)
} else if (mp_obj_is_callable(callback)) {
self->callback = callback;
uint8_t tim_id = self->timer->tim_id;
+ __HAL_TIM_CLEAR_IT(&self->timer->tim, TIMER_IRQ_MASK(self->channel));
if (tim_id == 1) {
HAL_NVIC_EnableIRQ(TIM1_CC_IRQn);
#if defined(TIM8) // STM32F401 doesn't have a TIM8