More random serial bit frobbing
[fw/altos] / target / serial / serial.c
index b0aead74233e004a56fa5c181a735b94a9ad8cfd..589452c0dbb730ba90eed438f52bf5ad60c76b5f 100644 (file)
@@ -188,11 +188,12 @@ usart_init(void)
        /*
         * Reasonable serial parameters
         */
-       U1UCR = (UxUCR_FLOW_DISABLE |
-                UxUCR_D9_EVEN_PARITY |
+       U1UCR = (UxUCR_FLUSH |
+                UxUCR_FLOW_DISABLE |
+                UxUCR_D9_ODD_PARITY |
                 UxUCR_BIT9_8_BITS |
                 UxUCR_PARITY_DISABLE |
-                UxUCR_SPB_1_STOP_BIT |
+                UxUCR_SPB_2_STOP_BITS |
                 UxUCR_STOP_HIGH |
                 UxUCR_START_LOW);
 }
@@ -200,10 +201,10 @@ usart_init(void)
 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 +236,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;
        }
 }