mirror of
https://github.com/esphome/esphome.git
synced 2026-10-14 02:02:51 +00:00
[emontx] Read UART bytes with read_byte() (#20514)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
1402cb7b64
commit
3df03e4be9
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user