feat(uart): uart break example improvement (#10525)
prints the HEXA and CHAR in order to allow the user to see why there is 1 extra char (0x00) when BREAK is received.
This commit is contained in:
parent
07c510e3ad
commit
74e4a744ce
1 changed files with 5 additions and 1 deletions
|
|
@ -80,7 +80,11 @@ void onReceiveFunction() {
|
|||
received_bytes = received_bytes + available;
|
||||
Serial.printf("onReceive Callback:: There are %d bytes available: {", available);
|
||||
while (available--) {
|
||||
Serial.print((char)Serial1.read());
|
||||
char c = Serial1.read();
|
||||
Serial.printf("0x%x='%c'", c, c);
|
||||
if (available) {
|
||||
Serial.print(" ");
|
||||
}
|
||||
}
|
||||
Serial.println("}");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue