[emontx] Read UART bytes with read_byte() (#20514)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Frédéric Metrich
2026-10-11 08:31:07 -04:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 1402cb7b64
commit 3df03e4be9
+3 -1
View File
@@ -18,7 +18,9 @@ void EmonTx::setup() { this->buffer_pos_ = 0; }
void EmonTx::loop() {
// Read all available data to prevent UART buffer overflow
while (this->available() > 0) {
uint8_t received = this->read();
uint8_t received;
if (!this->read_byte(&received))
break;
if (received == '\r') {
continue; // Ignore CR