summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/timer.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-02-23 13:18:14 +0000
committerDamien George <damien.p.george@gmail.com>2015-02-23 13:18:14 +0000
commitd38939e676d0c36d81b1763fa3fbfcb53c649710 (patch)
tree9916495aee75f33ced03d11b8f03191b94b89599 /stmhal/timer.c
parentcaf5c40c1932ff5f0dfd6a6b3cef870ffba13180 (diff)
downloadmicropython-d38939e676d0c36d81b1763fa3fbfcb53c649710.tar.gz
micropython-d38939e676d0c36d81b1763fa3fbfcb53c649710.zip
stmhal: Reset state of timer when deinit is called.
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 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