projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update changelogs for Debian build
[fw/altos]
/
src
/
ao_serial.c
diff --git
a/src/ao_serial.c
b/src/ao_serial.c
index 59110354efd3651192c7a4dd7199d03b7333152f..3f10376658cb10d02d627a9eed6c5b42be24b1c7 100644
(file)
--- a/
src/ao_serial.c
+++ b/
src/ao_serial.c
@@
-60,7
+60,10
@@
ao_serial_getchar(void) __critical
ao_sleep(&ao_usart1_rx_fifo);
ao_fifo_remove(ao_usart1_rx_fifo, c);
if (serial_echo) {
ao_sleep(&ao_usart1_rx_fifo);
ao_fifo_remove(ao_usart1_rx_fifo, c);
if (serial_echo) {
- printf("%02x\n", ((int) c) & 0xff);
+ printf("%02x ", ((int) c) & 0xff);
+ if (c >= ' ')
+ putchar(c);
+ putchar('\n');
flush();
}
return c;
flush();
}
return c;
@@
-82,16
+85,6
@@
ao_serial_drain(void) __critical
ao_sleep(&ao_usart1_tx_fifo);
}
ao_sleep(&ao_usart1_tx_fifo);
}
-static void
-send_serial(void)
-{
- ao_cmd_white();
- while (ao_cmd_lex_c != '\n') {
- ao_serial_putchar(ao_cmd_lex_c);
- ao_cmd_lex();
- }
-}
-
static void
monitor_serial(void)
{
static void
monitor_serial(void)
{
@@
-99,18
+92,9
@@
monitor_serial(void)
serial_echo = ao_cmd_lex_i != 0;
}
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[] = {
__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" },
{ 'M', monitor_serial, "M <enable> Monitor serial data" },
- { 'B', serial_baud, "B <0 = 4800, 1 = 57600> Set serial baud rate" },
- { 0, send_serial, NULL },
+ { 0, monitor_serial, NULL },
};
static const struct {
};
static const struct {
@@
-121,6
+105,10
@@
static const struct {
/* .baud = */ 163,
/* .gcr = */ (7 << UxGCR_BAUD_E_SHIFT) | UxGCR_ORDER_LSB
},
/* .baud = */ 163,
/* .gcr = */ (7 << UxGCR_BAUD_E_SHIFT) | UxGCR_ORDER_LSB
},
+ /* [AO_SERIAL_SPEED_9600] = */ {
+ /* .baud = */ 163,
+ /* .gcr = */ (8 << UxGCR_BAUD_E_SHIFT) | UxGCR_ORDER_LSB
+ },
/* [AO_SERIAL_SPEED_57600] = */ {
/* .baud = */ 59,
/* .gcr = */ (11 << UxGCR_BAUD_E_SHIFT) | UxGCR_ORDER_LSB
/* [AO_SERIAL_SPEED_57600] = */ {
/* .baud = */ 59,
/* .gcr = */ (11 << UxGCR_BAUD_E_SHIFT) | UxGCR_ORDER_LSB