diff options
author | Keith Packard <keithp@keithp.com> | 2009-04-21 01:17:03 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2009-04-21 01:17:03 -0700 |
commit | d1887ded41a5bfec8e10e9fd736fa9444b9b6222 (patch) | |
tree | 936c2e251c195d80e13a0754931ba188fbf7e5ad /ao_telemetry.c | |
parent | 43c8f7012102cdb591ace899420c10e4a78385ad (diff) |
Fix up fancy dbg stuff. Add teleterra initial bits.
The dbg stuff needed a bit of help to actually walk the tables; it appears
that complex expressions confuse sdcc.
This also adds primitive teleterra bits, but no UI, etc.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'ao_telemetry.c')
-rw-r--r-- | ao_telemetry.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ao_telemetry.c b/ao_telemetry.c index 092918d4..b46f03c7 100644 --- a/ao_telemetry.c +++ b/ao_telemetry.c @@ -34,16 +34,18 @@ ao_telemetry_send(__xdata struct ao_telemetry *telemetry) __reentrant void ao_telemetry(void) { - static __xdata struct ao_radio_recv recv; + static __xdata struct ao_telemetry telemetry; static uint8_t state; while (ao_flight_state == ao_flight_startup || ao_flight_state == ao_flight_idle) ao_sleep(DATA_TO_XDATA(&ao_flight_state)); - recv.telemetry.type = AO_TELEMETRY_SENSOR; for (;;) { - ao_adc_get(&recv.telemetry.u.adc); - ao_telemetry_send(&recv.telemetry); + ao_adc_get(&telemetry.adc); + ao_mutex_get(&ao_gps_mutex); + memcpy(&telemetry.gps, &ao_gps_data, sizeof (struct ao_gps_data)); + ao_mutex_put(&ao_gps_mutex); + ao_telemetry_send(&telemetry); ao_delay(AO_MS_TO_TICKS(1000)); } } |