Flip serial TX code around a bit
[fw/altos] / target / serial / serial.c
index 6065d9719313f8d2d943e97413f99abeada7c5fa..d2be47fdeb1ed7cd9f53dce9b3e8d9ae258691fa 100644 (file)
@@ -193,17 +193,17 @@ usart_init(void)
                 UxUCR_BIT9_8_BITS |
                 UxUCR_PARITY_DISABLE |
                 UxUCR_SPB_1_STOP_BIT |
-                UxUCR_STOP_LOW |
-                UxUCR_START_HIGH);
+                UxUCR_STOP_HIGH |
+                UxUCR_START_LOW);
 }
 
 void
 usart_out_byte(uint8_t byte)
 {
-       U1CSR &= ~UxCSR_TX_BYTE;
        U1DBUF = byte;
        while ((U1CSR & UxCSR_TX_BYTE) == 0)
                ;
+       U1CSR &= ~UxCSR_TX_BYTE;
 }
 
 uint8_t
@@ -235,9 +235,8 @@ main ()
        spi_init();
 
        for (;;) {
-               for (i = 0; i < sizeof (string) - 1; i++) {
-                       usart_out_byte(string[i]);
-               }
+               usart_out_byte('A');
+               delay(5);
                P1 ^= 2;
        }
 }