Only use input when the previous byte is complete
authorMatt Mullins <mmullins@mmlx.us>
Sun, 23 Dec 2012 22:09:25 +0000 (14:09 -0800)
committerMatt Mullins <mmullins@mmlx.us>
Sun, 23 Dec 2012 22:09:25 +0000 (14:09 -0800)
main.c

diff --git a/main.c b/main.c
index 0aed93b..d6cdc51 100644 (file)
--- a/main.c
+++ b/main.c
@@ -93,12 +93,13 @@ __attribute__((isr))
 void uart0_isr() {
        // Receive data, increment by 1 and send it back through the UART
        int data = UART0_DR_R & 0xFF;
-       blink_char = data;
+       if (!bit_count) {
+               blink_char = data;
+               bit_count = 8;
+       }
 
        data = (data + 1) & 0xFF;
        UART0_DR_R = data;
-
-       bit_count = 8;
 }
 
 __attribute__((isr))