diff options
| author | Keith Packard <keithp@keithp.com> | 2010-02-13 16:42:27 -0800 |
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2010-02-13 16:42:27 -0800 |
| commit | 876e9a10b9096ead85fbe08ec9a6a0329cf7cbd4 (patch) | |
| tree | d87d21c73a2b91f094207fb8b7d14374c66f9e84 /src/ao_gps_skytraq.c | |
| parent | c83615567b4567f3dc45a7f7b894943b45fbb65c (diff) | |
Log GPS data on pad after boost detect.
This wakes up the two GPS reporting tasks and gets them to report out
any existing GPS data to the log file. To make sure the timestamps in
that GPS data are accurate, this also records GPS time on receipt of
the GPS data instead of when that is logged.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/ao_gps_skytraq.c')
| -rw-r--r-- | src/ao_gps_skytraq.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ao_gps_skytraq.c b/src/ao_gps_skytraq.c index 0dd45c0c..ae8c7ef7 100644 --- a/src/ao_gps_skytraq.c +++ b/src/ao_gps_skytraq.c @@ -28,9 +28,11 @@ static __xdata char ao_gps_char; static __xdata uint8_t ao_gps_cksum; static __xdata uint8_t ao_gps_error; +__xdata uint16_t ao_gps_tick; __xdata struct ao_gps_data ao_gps_data; __xdata struct ao_gps_tracking_data ao_gps_tracking_data; +static __xdata uint16_t ao_gps_next_tick; static __xdata struct ao_gps_data ao_gps_next; static __xdata uint8_t ao_gps_date_flags; static __xdata struct ao_gps_tracking_data ao_gps_tracking_next; @@ -248,6 +250,7 @@ ao_gps(void) __reentrant * *66 checksum */ + ao_gps_next_tick = ao_time(); ao_gps_next.flags = AO_GPS_RUNNING | ao_gps_date_flags; ao_gps_next.hour = ao_gps_decimal(2); ao_gps_next.minute = ao_gps_decimal(2); @@ -297,6 +300,7 @@ ao_gps(void) __reentrant ao_gps_error = 1; if (!ao_gps_error) { ao_mutex_get(&ao_gps_mutex); + ao_gps_tick = ao_gps_next_tick; memcpy(&ao_gps_data, &ao_gps_next, sizeof (struct ao_gps_data)); ao_mutex_put(&ao_gps_mutex); ao_wakeup(&ao_gps_data); |
