X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fstm%2Fao_timer.c;h=387df184c7747bb3f595c1c6d00d86a80d09993c;hb=6da2f5846f2d28ea1f09f60ef2cc3f68113ac62a;hp=76304f0e2b9fea2c590dbb55ab0c00c198a17eaf;hpb=8ba5344514f8ed51f6fd69ca09f6c7035c4fd0da;p=fw%2Faltos 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