summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/fox1ihu/flash-loader/ao_pins.h2
-rw-r--r--src/stm/ao_timer.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/src/fox1ihu/flash-loader/ao_pins.h b/src/fox1ihu/flash-loader/ao_pins.h
index 19f29b08..c4fa69bd 100644
--- a/src/fox1ihu/flash-loader/ao_pins.h
+++ b/src/fox1ihu/flash-loader/ao_pins.h
@@ -45,7 +45,7 @@
AO_WATCHDOG_PORT->odr ^= (1 << AO_WATCHDOG_BIT); \
} while (0)
-#define HAS_TICK 1
+#define HAS_TICK 0
#include <ao_flash_stm_pins.h>
/* Attached signal, PB8 */
diff --git a/src/stm/ao_timer.c b/src/stm/ao_timer.c
index 7b526902..9d118b72 100644
--- a/src/stm/ao_timer.c
+++ b/src/stm/ao_timer.c
@@ -26,6 +26,8 @@
#define HAS_TICK 1
#endif
+#if HAS_TICK || defined(AO_TIMER_HOOK)
+
#if HAS_TICK
volatile AO_TICK_TYPE ao_tick_count;
@@ -34,6 +36,7 @@ ao_time(void)
{
return ao_tick_count;
}
+#endif
#if AO_DATA_ALL
volatile __data uint8_t ao_data_interval = 1;
@@ -44,7 +47,9 @@ void stm_systick_isr(void)
{
ao_validate_cur_stack();
if (stm_systick.csr & (1 << STM_SYSTICK_CSR_COUNTFLAG)) {
+#if HAS_TICK
++ao_tick_count;
+#endif
#if HAS_TASK_QUEUE
if (ao_task_alarm_tick && (int16_t) (ao_tick_count - ao_task_alarm_tick) >= 0)
ao_task_check_alarm((uint16_t) ao_tick_count);