[usb_uart] Fix FTDI RX data stall / corruption and input restart reliability (#17348)

Co-authored-by: Oliver Kleinecke <kleinecke.oliver@googlemail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Oliver Kleinecke
2026-07-07 21:55:49 +10:00
committed by GitHub
co-authored by Oliver Kleinecke Claude Sonnet 4.6
parent 40c3a4320f
commit af4a6e7ec3
3 changed files with 50 additions and 16 deletions
+5
View File
@@ -228,6 +228,11 @@ void USBUartComponent::loop() {
}
#endif
// If there is not enough space for the full chunk, let the device subclass
// handle it (e.g. FTDI clears the buffer to prevent mid-telegram corruption).
if (channel->input_buffer_.get_free_space() < chunk->length) {
this->on_rx_overflow(channel);
}
// Push data to ring buffer (now safe in main loop)
channel->input_buffer_.push(chunk->data, chunk->length);