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_sirf.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_sirf.c')
-rw-r--r-- | src/drivers/ao_gps_sirf.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/drivers/ao_gps_sirf.c b/src/drivers/ao_gps_sirf.c index 91fc948b..d89435b9 100644 --- a/src/drivers/ao_gps_sirf.c +++ b/src/drivers/ao_gps_sirf.c @@ -19,6 +19,7 @@ #include "ao.h" #endif +__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; @@ -422,8 +423,9 @@ ao_gps(void) __reentrant else ao_gps_data.v_error = ao_sirf_data.v_error / 100; #endif + ao_gps_new |= AO_GPS_NEW_DATA; ao_mutex_put(&ao_gps_mutex); - ao_wakeup(&ao_gps_data); + ao_wakeup(&ao_gps_new); break; case 4: ao_mutex_get(&ao_gps_mutex); @@ -432,8 +434,9 @@ ao_gps(void) __reentrant ao_gps_tracking_data.sats[i].svid = ao_sirf_tracker_data.sats[i].svid; ao_gps_tracking_data.sats[i].c_n_1 = ao_sirf_tracker_data.sats[i].c_n_1; } + ao_gps_new |= AO_GPS_NEW_TRACKING; ao_mutex_put(&ao_gps_mutex); - ao_wakeup(&ao_gps_tracking_data); + ao_wakeup(&ao_gps_new); break; } } |