From 398c02b945a58634c8932f07df2c2be8438da7d1 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 9 Apr 2013 00:28:05 -0700 Subject: altoslib/altosui: Carry receiver status around in AltosListenerState This moves the crc_errors into the new structure and adds a receiver battery voltage value there as well. Now the receiver status can be monitored separately from the flight status. That also means that code receiving state updates should be prepared to accept missing listener or flight state values. Signed-off-by: Keith Packard --- src/core/ao.h | 2 +- src/stm/ao_timer.c | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/core/ao.h b/src/core/ao.h index 6c790f69..977e10b8 100644 --- a/src/core/ao.h +++ b/src/core/ao.h @@ -94,7 +94,7 @@ extern volatile __data AO_TICK_TYPE ao_tick_count; #define AO_SEC_TO_TICKS(s) ((s) * AO_HERTZ) /* Returns the current time in ticks */ -uint16_t +AO_TICK_TYPE ao_time(void); /* Suspend the current task until ticks time has passed */ diff --git a/src/stm/ao_timer.c b/src/stm/ao_timer.c index e07625d8..8b7c2327 100644 --- a/src/stm/ao_timer.c +++ b/src/stm/ao_timer.c @@ -18,15 +18,12 @@ #include "ao.h" #include -volatile __data AO_TICK_TYPE ao_tick_count; +volatile AO_TICK_TYPE ao_tick_count; -uint16_t ao_time(void) +AO_TICK_TYPE +ao_time(void) { - uint16_t v; - ao_arch_critical( - v = ao_tick_count; - ); - return v; + return ao_tick_count; } #if AO_DATA_ALL -- cgit v1.2.3