diff --git a/uart/main.cpp b/uart/main.cpp index 2d09849..cc2f359 100644 --- a/uart/main.cpp +++ b/uart/main.cpp @@ -21,8 +21,20 @@ void newUartUsage() while (true) { uint8_t received = 0; - if (serial1.rxByte(received)) + while (!serial1.peek(received)) + ; + + { + serial1 << F("Peeked: "); serial1.txByte(received); + serial1 << F("\r\n"); + } + + if (serial1.rxByte(received)) { + serial1 << F("Received: "); + serial1.txByte(received); + serial1 << F("\r\n"); + } } _delay_ms(1000); diff --git a/uart/uart b/uart/uart index 0bfd303..a3d76a1 160000 --- a/uart/uart +++ b/uart/uart @@ -1 +1 @@ -Subproject commit 0bfd303a26a8aad77607e9cefb1039997952af09 +Subproject commit a3d76a138ddb9e5c0e7607aae38248ef0b33959b