diff options
author | Keith Packard <keithp@keithp.com> | 2009-04-20 23:33:41 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2009-04-20 23:33:41 -0700 |
commit | 43c8f7012102cdb591ace899420c10e4a78385ad (patch) | |
tree | 6ce45d0a58b1133961acd3cda3f3be21fef085b4 /ao_adc.c | |
parent | 5be13b76a2e29b84cd6d1eec065e3354b0dafce5 (diff) |
Add radio support. Build separate executables for TeleMetrum and the TI dongle
Ok, way too big a patch, but things were in rough shape.
This patch adds support for the radio, both transmit and receive.
Then, because I could no longer run the TeleMetrum code on the TI
dongle, I ended up building a separate image for the TI board, which
involved creating a mechanism for having multiple command sets and splitting
code for different functions into different files.
Diffstat (limited to 'ao_adc.c')
-rw-r--r-- | ao_adc.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -65,6 +65,21 @@ ao_adc_isr(void) interrupt 1 } } +static void +ao_adc_dump(void) +{ + __xdata struct ao_adc packet; + ao_adc_get(&packet); + printf("tick: %5u accel: %4d pres: %4d temp: %4d batt: %4d drogue: %4d main: %4d\n", + packet.tick, packet.accel >> 4, packet.pres >> 4, packet.temp >> 4, + packet.sense_d >> 4, packet.sense_m >> 4); +} + +__code struct ao_cmds ao_adc_cmds[] = { + { 'a', ao_adc_dump, "a Display current ADC values\n" }, + { 0, ao_adc_dump, NULL }, +}; + void ao_adc_init(void) { @@ -78,5 +93,6 @@ ao_adc_init(void) /* enable interrupts */ ADCIF = 0; IEN0 |= IEN0_ADCIE; + ao_cmd_register(&ao_adc_cmds[0]); } |