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_serial.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_serial.c')
-rw-r--r-- | ao_serial.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/ao_serial.c b/ao_serial.c index 215a301d..a2292980 100644 --- a/ao_serial.c +++ b/ao_serial.c @@ -90,6 +90,21 @@ ao_serial_putchar(uint8_t c) __critical ao_serial_tx1_start(); } +static void +send_serial(void) +{ + ao_cmd_white(); + while (ao_cmd_lex_c != '\n') { + ao_serial_putchar(ao_cmd_lex_c); + ao_cmd_lex(); + } +} + +__code struct ao_cmds ao_serial_cmds[] = { + { 'S', send_serial, "S<data> Send data to serial line\n" }, + { 0, send_serial, NULL }, +}; + void ao_serial_init(void) { @@ -120,4 +135,6 @@ ao_serial_init(void) IEN0 |= IEN0_URX1IE; IEN2 |= IEN2_UTX1IE; + + ao_cmd_register(&ao_serial_cmds[0]); } |