diff options
author | Keith Packard <keithp@keithp.com> | 2011-07-04 23:39:21 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-07-04 23:39:21 -0700 |
commit | ef3ce687d73c1274ce5368432f4d449b063ce5c0 (patch) | |
tree | 5b5688d72cc3256bd75dd0db813aa4b8dee87bef /src/ao_gps_report.c | |
parent | 359681f23e2f71bc8f4975a4a76ae28c08ecab2e (diff) |
altos: Complete new telemetry switchover
This involved rewriting the GPS code to use the telemetry structures
directly so that a memcpy could be used to transfer the data to the
telemetry packets, saving a bunch of code space, along with fixing up
the gps testing programs to deal with the structure changes.
In addition, the teledongle code needed to have the monitoring code
split into separate radio receiver and USB writer threads as the
packets are now back-to-back, and hence come too fast to wait for the
USB data to be sent to the host after each one.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/ao_gps_report.c')
-rw-r--r-- | src/ao_gps_report.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ao_gps_report.c b/src/ao_gps_report.c index 7abc93f5..e57f8744 100644 --- a/src/ao_gps_report.c +++ b/src/ao_gps_report.c @@ -20,14 +20,14 @@ void ao_gps_report(void) { - static __xdata struct ao_log_record gps_log; - static __xdata struct ao_gps_data gps_data; + static __xdata struct ao_log_record gps_log; + static __xdata struct ao_telemetry_location gps_data; uint8_t date_reported = 0; for (;;) { ao_sleep(&ao_gps_data); ao_mutex_get(&ao_gps_mutex); - memcpy(&gps_data, &ao_gps_data, sizeof (struct ao_gps_data)); + memcpy(&gps_data, &ao_gps_data, sizeof (ao_gps_data)); ao_mutex_put(&ao_gps_mutex); if (!(gps_data.flags & AO_GPS_VALID)) @@ -64,15 +64,15 @@ ao_gps_report(void) void ao_gps_tracking_report(void) { - static __xdata struct ao_log_record gps_log; - static __xdata struct ao_gps_tracking_data gps_tracking_data; + static __xdata struct ao_log_record gps_log; + static __xdata struct ao_telemetry_satellite gps_tracking_data; uint8_t c, n; for (;;) { ao_sleep(&ao_gps_tracking_data); ao_mutex_get(&ao_gps_mutex); gps_log.tick = ao_gps_tick; - memcpy(&gps_tracking_data, &ao_gps_tracking_data, sizeof (struct ao_gps_tracking_data)); + memcpy(&gps_tracking_data, &ao_gps_tracking_data, sizeof (ao_gps_tracking_data)); ao_mutex_put(&ao_gps_mutex); if (!(n = gps_tracking_data.channels)) |