diff options
author | Keith Packard <keithp@keithp.com> | 2013-10-14 22:41:43 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2013-10-14 22:41:43 -0700 |
commit | 039446f54ef6968a3f0b37ce32ca6bdcdbe62546 (patch) | |
tree | d66195ea4d80894af1b4ab771a6878abb770848a /src/drivers/ao_gps_ublox.c | |
parent | 5c4b3658a96f1a64ccebf7bddda06b15b4ac4a6f (diff) |
altos: Merge GPS logging into a single function
Create a new global, ao_gps_new, which indicates new GPS position and
satellite data.
Use ao_gps_new as the new sleep/wakeup address.
Merge the separate gps position/satellite logging tasks into a single
function which waits for new data and writes out the changed values.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/drivers/ao_gps_ublox.c')
-rw-r--r-- | src/drivers/ao_gps_ublox.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/drivers/ao_gps_ublox.c b/src/drivers/ao_gps_ublox.c index e9168348..3582d6e0 100644 --- a/src/drivers/ao_gps_ublox.c +++ b/src/drivers/ao_gps_ublox.c @@ -25,6 +25,7 @@ #include <stdarg.h> +__xdata uint8_t ao_gps_new; __xdata uint8_t ao_gps_mutex; __pdata uint16_t ao_gps_tick; __xdata struct ao_telemetry_location ao_gps_data; @@ -760,8 +761,8 @@ ao_gps(void) __reentrant } ao_mutex_put(&ao_gps_mutex); - ao_wakeup(&ao_gps_data); - ao_wakeup(&ao_gps_tracking_data); + ao_gps_new = AO_GPS_NEW_DATA | AO_GPS_NEW_TRACKING; + ao_wakeup(&ao_gps_new); break; } break; |