summaryrefslogtreecommitdiff
path: root/src/stm/ao_timer.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2018-08-13 17:43:13 -0700
committerKeith Packard <keithp@keithp.com>2018-08-15 15:40:15 -0700
commitf16d1e3a2f074b96aae6b9053e8e9e03bd282741 (patch)
tree717f66d2a6fcbff2fc0145ac4dfaf8b71c298d41 /src/stm/ao_timer.c
parentbb9d071d328969fc3c544897f1fc96e55a842198 (diff)
altos: Allow timer interrupt without needing tick count
This saves a bit of space in the fox1ihu loader which uses the timer interrupt to poke the watchdog. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/stm/ao_timer.c')
-rw-r--r--src/stm/ao_timer.c5
1 files changed, 5 insertions, 0 deletions
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);