src/cc1111: Allow serial0 without serial1
authorKeith Packard <keithp@keithp.com>
Sun, 5 Aug 2012 19:16:25 +0000 (12:16 -0700)
committerKeith Packard <keithp@keithp.com>
Sun, 5 Aug 2012 19:16:25 +0000 (12:16 -0700)
The ao_serial_speed structure is needed by serial0 too.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/cc1111/ao_serial.c

index d90103b0f09e6b64c585d62339990dc44651a4a4..d5431070d7b430ab8a2095460855a353ea2db3c3 100644 (file)
 
 #include "ao.h"
 
 
 #include "ao.h"
 
+const __code struct ao_serial_speed ao_serial_speeds[] = {
+       /* [AO_SERIAL_SPEED_4800] = */ {
+               /* .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_19200] = */ {
+               /* .baud = */ 163,
+               /* .gcr  = */ (9 << UxGCR_BAUD_E_SHIFT) | UxGCR_ORDER_LSB
+       },
+       /* [AO_SERIAL_SPEED_57600] = */ {
+               /* .baud = */ 59,
+               /* .gcr =  */ (11 << UxGCR_BAUD_E_SHIFT) | UxGCR_ORDER_LSB
+       },
+};
+
 #if HAS_SERIAL_0
 
 volatile __xdata struct ao_fifo        ao_serial0_rx_fifo;
 #if HAS_SERIAL_0
 
 volatile __xdata struct ao_fifo        ao_serial0_rx_fifo;
@@ -181,25 +200,6 @@ ao_serial1_drain(void) __critical
                ao_sleep(&ao_serial1_tx_fifo);
 }
 
                ao_sleep(&ao_serial1_tx_fifo);
 }
 
-const __code struct ao_serial_speed ao_serial_speeds[] = {
-       /* [AO_SERIAL_SPEED_4800] = */ {
-               /* .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_19200] = */ {
-               /* .baud = */ 163,
-               /* .gcr  = */ (9 << UxGCR_BAUD_E_SHIFT) | UxGCR_ORDER_LSB
-       },
-       /* [AO_SERIAL_SPEED_57600] = */ {
-               /* .baud = */ 59,
-               /* .gcr =  */ (11 << UxGCR_BAUD_E_SHIFT) | UxGCR_ORDER_LSB
-       },
-};
-
 void
 ao_serial1_set_speed(uint8_t speed)
 {
 void
 ao_serial1_set_speed(uint8_t speed)
 {