From ce1b760b297811725f286259e6943063440ddb4d Mon Sep 17 00:00:00 2001 From: Piero Andreini Date: Sun, 5 Apr 2026 13:30:15 +0200 Subject: [PATCH] fix: Address Inxsamox86 review feedback - Add PIN_USER_BTN_ANA=7 globally to platformio.ini - Remove abs() from millis() comparison (unsigned overflow) - Add auto declaration to ev variable in PIN_USER_BTN_ANA block Fixes compilation errors on ESP32-S3 with analog button support --- examples/companion_radio/ui-new/UITask.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/companion_radio/ui-new/UITask.cpp b/examples/companion_radio/ui-new/UITask.cpp index c98f3ead..5a3aef9d 100644 --- a/examples/companion_radio/ui-new/UITask.cpp +++ b/examples/companion_radio/ui-new/UITask.cpp @@ -740,8 +740,8 @@ void UITask::loop() { } #endif #if defined(PIN_USER_BTN_ANA) - if ((long)(millis() - _analogue_pin_read_millis) > 10) { - int ev = analog_btn.check(); + if (millis() - _analogue_pin_read_millis > 10) { + auto ev = analog_btn.check(); if (ev == BUTTON_EVENT_CLICK) { c = checkDisplayOn(KEY_NEXT); } else if (ev == BUTTON_EVENT_LONG_PRESS) {