From: Matt Mullins Date: Sun, 23 Dec 2012 22:09:25 +0000 (-0800) Subject: Only use input when the previous byte is complete X-Git-Url: http://git.mmlx.us/?a=commitdiff_plain;h=02608ed76dd8cc195e1a9716e8f66eda1cdf1582;p=stellaris%2Fled_blink.git Only use input when the previous byte is complete --- diff --git a/main.c b/main.c index 0aed93b..d6cdc51 100644 --- 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))