projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
AltosSiteMap: explain tile size better
[fw/altos]
/
src
/
ao_serial.c
diff --git
a/src/ao_serial.c
b/src/ao_serial.c
index 4155e776934ac59f196e67642aa23d462d011025..a48734c2f22793a957fb9575f6f5d0d2e0d21c26 100644
(file)
--- a/
src/ao_serial.c
+++ b/
src/ao_serial.c
@@
-21,7
+21,7
@@
volatile __xdata struct ao_fifo ao_usart1_rx_fifo;
volatile __xdata struct ao_fifo ao_usart1_tx_fifo;
void
volatile __xdata struct ao_fifo ao_usart1_tx_fifo;
void
-ao_serial_rx1_isr(void) interrupt 3
+ao_serial_rx1_isr(void)
__
interrupt 3
{
if (!ao_fifo_full(ao_usart1_rx_fifo))
ao_fifo_insert(ao_usart1_rx_fifo, U1DBUF);
{
if (!ao_fifo_full(ao_usart1_rx_fifo))
ao_fifo_insert(ao_usart1_rx_fifo, U1DBUF);
@@
-42,7
+42,7
@@
ao_serial_tx1_start(void)
}
void
}
void
-ao_serial_tx1_isr(void) interrupt 14
+ao_serial_tx1_isr(void)
__
interrupt 14
{
UTX1IF = 0;
ao_serial_tx1_started = 0;
{
UTX1IF = 0;
ao_serial_tx1_started = 0;
@@
-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)
{
@@
-100,9
+93,8
@@
monitor_serial(void)
}
__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" },
- { 0,
send
_serial, NULL },
+ { 0,
monitor
_serial, NULL },
};
static const struct {
};
static const struct {
@@
-113,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