Add B command to set serial baud rate
authorKeith Packard <keithp@keithp.com>
Sat, 18 Jul 2009 08:05:33 +0000 (01:05 -0700)
committerKeith Packard <keithp@keithp.com>
Sat, 18 Jul 2009 08:05:33 +0000 (01:05 -0700)
Signed-off-by: Keith Packard <keithp@keithp.com>
src/ao_serial.c

index 4155e776934ac59f196e67642aa23d462d011025..59110354efd3651192c7a4dd7199d03b7333152f 100644 (file)
@@ -99,9 +99,17 @@ monitor_serial(void)
        serial_echo = ao_cmd_lex_i != 0;
 }
 
+static void
+serial_baud(void)
+{
+       ao_cmd_hex();
+       ao_serial_set_speed(ao_cmd_lex_i);
+}
+
 __code struct ao_cmds ao_serial_cmds[] = {
        { 'S', send_serial,             "S <data>                           Send data to serial line" },
        { 'M', monitor_serial,          "M <enable>                         Monitor serial data" },
+       { 'B', serial_baud,             "B <0 = 4800, 1 = 57600>            Set serial baud rate" },
        { 0, send_serial, NULL },
 };