From 59cbf80e63b4c88de45e59c6e3d209f99910fcf3 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 21 Jan 2022 19:45:14 -0800 Subject: [PATCH] data_interval == 0 means no data collection All of the timer functions were still taking one sample every 256 clock ticks. Signed-off-by: Keith Packard --- src/stm/ao_timer.c | 2 +- src/stm32f4/ao_timer.c | 2 +- src/stm32l0/ao_timer.c | 2 +- src/stmf0/ao_timer.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/stm/ao_timer.c b/src/stm/ao_timer.c index 0d81b5de..eec0a35a 100644 --- a/src/stm/ao_timer.c +++ b/src/stm/ao_timer.c @@ -69,7 +69,7 @@ void stm_systick_isr(void) #endif ao_task_check_alarm(); #if AO_DATA_ALL - if (++ao_data_count == ao_data_interval) { + if (++ao_data_count == ao_data_interval && ao_data_interval) { ao_data_count = 0; #if HAS_FAKE_FLIGHT if (ao_fake_flight_active) diff --git a/src/stm32f4/ao_timer.c b/src/stm32f4/ao_timer.c index 999b587f..83ffe4a7 100644 --- a/src/stm32f4/ao_timer.c +++ b/src/stm32f4/ao_timer.c @@ -49,7 +49,7 @@ void stm_systick_isr(void) #endif ao_task_check_alarm(); #if AO_DATA_ALL - if (++ao_data_count == ao_data_interval) { + if (++ao_data_count == ao_data_interval && ao_data_interval) { ao_data_count = 0; #if HAS_FAKE_FLIGHT if (ao_fake_flight_active) diff --git a/src/stm32l0/ao_timer.c b/src/stm32l0/ao_timer.c index 89193333..6d447fc9 100644 --- a/src/stm32l0/ao_timer.c +++ b/src/stm32l0/ao_timer.c @@ -64,7 +64,7 @@ void stm_systick_isr(void) ++ao_tick_count; ao_task_check_alarm(); #if AO_DATA_ALL - if (++ao_data_count == ao_data_interval) { + if (++ao_data_count == ao_data_interval && ao_data_interval) { ao_data_count = 0; #if HAS_ADC #if HAS_FAKE_FLIGHT diff --git a/src/stmf0/ao_timer.c b/src/stmf0/ao_timer.c index b0b6ec0a..5b180074 100644 --- a/src/stmf0/ao_timer.c +++ b/src/stmf0/ao_timer.c @@ -62,7 +62,7 @@ void stm_systick_isr(void) ++ao_tick_count; ao_task_check_alarm(); #if AO_DATA_ALL - if (++ao_data_count == ao_data_interval) { + if (++ao_data_count == ao_data_interval && ao_data_interval) { ao_data_count = 0; #if HAS_ADC #if HAS_FAKE_FLIGHT -- 2.30.2