Check serial input
authorKeith Packard <keithp@keithp.com>
Wed, 25 Mar 2009 07:55:11 +0000 (00:55 -0700)
committerKeith Packard <keithp@keithp.com>
Wed, 25 Mar 2009 07:55:11 +0000 (00:55 -0700)
target/serial/serial.c

index ebe7e2fc891b3be7a529c5c8b113db177f166cfb..2939042635ca84d48e0ea586d9fa6d518ea9d1cd 100644 (file)
@@ -241,6 +241,18 @@ usart_in_byte(void)
        return b;
 }
 
+void
+debug_byte(uint8_t byte)
+{
+       uint8_t s;
+
+       for (s = 0; s < 8; s++) {
+               DEBUG = byte & 1;
+               delay(5);
+               byte >>= 1;
+       }
+}
+
 main ()
 {
        P1DIR |= 2;
@@ -252,7 +264,7 @@ main ()
 
        for (;;) {
                usart_out_string("hello world\r\n");
-               delay(5);
-               P1 ^= 2;
+               debug_byte(usart_in_byte());
        }
+       
 }