From d38939e676d0c36d81b1763fa3fbfcb53c649710 Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 23 Feb 2015 13:18:14 +0000 Subject: [PATCH] stmhal: Reset state of timer when deinit is called. --- stmhal/timer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/stmhal/timer.c b/stmhal/timer.c index ffc931e9d5..9d77eae432 100644 --- a/stmhal/timer.c +++ b/stmhal/timer.c @@ -686,6 +686,7 @@ STATIC mp_obj_t pyb_timer_deinit(mp_obj_t self_in) { prev_chan->next = NULL; } + self->tim.State = HAL_TIM_STATE_RESET; self->tim.Instance->CCER = 0x0000; // disable all capture/compare outputs self->tim.Instance->CR1 = 0x0000; // disable the timer and reset its state