summaryrefslogtreecommitdiff
path: root/src/stm/ao_timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stm/ao_timer.c')
-rw-r--r--src/stm/ao_timer.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/stm/ao_timer.c b/src/stm/ao_timer.c
index 76304f0e..387df184 100644
--- a/src/stm/ao_timer.c
+++ b/src/stm/ao_timer.c
@@ -48,13 +48,16 @@ ao_debug_out(char c);
void stm_tim6_isr(void)
{
- ++ao_tick_count;
+ if (stm_tim6.sr & (1 << STM_TIM67_SR_UIF)) {
+ stm_tim6.sr = 0;
+ ++ao_tick_count;
#if HAS_ADC
- if (++ao_adc_count == ao_adc_interval) {
- ao_adc_count = 0;
- ao_adc_poll();
- }
+ if (++ao_adc_count == ao_adc_interval) {
+ ao_adc_count = 0;
+ ao_adc_poll();
+ }
#endif
+ }
}
#if HAS_ADC