Skip to content

Commit

Permalink
feat(uart): uart break example improvement
Browse files Browse the repository at this point in the history
prints the HEXA and CHAR in order to allow the user to see why there is 1 extra char (0x00) when BREAK is received.
  • Loading branch information
SuGlider authored Oct 25, 2024
1 parent 07c510e commit 36a7294
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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("}");
}
Expand Down

0 comments on commit 36a7294

Please sign in to comment.