X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=ao_serial.c;h=2ed0791408d030d5ad127c942f32344c04a8194f;hp=215a301d0f32e25ef3163894a54b9253423cb1f3;hb=45976af820fc41099928df71ea8304c56eb9fc7c;hpb=022f83ca6fd589005d8eb3e25e633950fef69fa7 diff --git a/ao_serial.c b/ao_serial.c index 215a301d..2ed07914 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 Send data to serial line" }, + { 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]); }