From 02608ed76dd8cc195e1a9716e8f66eda1cdf1582 Mon Sep 17 00:00:00 2001 From: Matt Mullins Date: Sun, 23 Dec 2012 14:09:25 -0800 Subject: [PATCH] Only use input when the previous byte is complete --- main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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)) -- 2.11.0