From 14d8e68466cdc4fbda3abe5b5cc78ea64a4a8be4 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Tue, 9 Feb 2016 13:49:04 +0100 Subject: ucoo/hal/timer: clear interrupt flag --- ucoo/hal/timer/timer.stm32.hh | 2 ++ ucoo/hal/timer/timer.stm32.tcc | 7 +++++++ 2 files changed, 9 insertions(+) (limited to 'ucoo') diff --git a/ucoo/hal/timer/timer.stm32.hh b/ucoo/hal/timer/timer.stm32.hh index f139fce..85941e4 100644 --- a/ucoo/hal/timer/timer.stm32.hh +++ b/ucoo/hal/timer/timer.stm32.hh @@ -62,6 +62,8 @@ class TimerHard void enable_interrupt (); /// Disable interrupts on update event. void disable_interrupt (); + /// Clear update event interrupt flag. + void clear_interrupt (); private: /// Enable updates (reload value, output compare values...). void enable_updates (); diff --git a/ucoo/hal/timer/timer.stm32.tcc b/ucoo/hal/timer/timer.stm32.tcc index 4083f26..e95deff 100644 --- a/ucoo/hal/timer/timer.stm32.tcc +++ b/ucoo/hal/timer/timer.stm32.tcc @@ -241,6 +241,13 @@ TimerHard::disable_interrupt () TIM_DIER (Base) &= ~TIM_DIER_UIE; } +template +void +TimerHard::clear_interrupt () +{ + TIM_SR (Base) = ~TIM_SR_UIF; +} + template void TimerHard::enable_updates () -- cgit v1.2.3