[usb_uart][nextion][feedback][whirlpool][packet_transport][he60r][hc8][runtime_stats] Fix millis() wrapping bugs (#14474)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
Jonathan Swoboda
2026-03-05 16:08:58 -05:00
committed by GitHub
co-authored by Claude Opus 4.6 J. Nick Koston
parent b0be02e16d
commit 3392e4d73b
11 changed files with 44 additions and 37 deletions
+2 -2
View File
@@ -171,8 +171,8 @@ void USBUartChannel::flush() {
// Safe to call from the main loop only.
// The 100 ms timeout guards against a device that stops responding mid-flush;
// in that case the main loop is blocked for the full duration.
uint32_t deadline = millis() + 100; // 100 ms safety timeout
while ((!this->output_queue_.empty() || this->output_started_.load()) && millis() < deadline) {
uint32_t start = millis(); // 100 ms safety timeout
while ((!this->output_queue_.empty() || this->output_started_.load()) && millis() - start < 100) {
// Kick start_output() in case data arrived but no transfer is in flight yet.
this->parent_->start_output(this);
yield();