Changed example to use peeking
This commit is contained in:
parent
408ab83afb
commit
5047b661af
@ -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);
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 0bfd303a26a8aad77607e9cefb1039997952af09
|
||||
Subproject commit a3d76a138ddb9e5c0e7607aae38248ef0b33959b
|
Loading…
Reference in New Issue
Block a user