From 4e8ae7b1085724002051aaea5e49d8e579823071 Mon Sep 17 00:00:00 2001 From: HarukiToreda <116696711+HarukiToreda@users.noreply.github.com> Date: Wed, 7 May 2025 02:49:11 -0400 Subject: [PATCH] Removed Jitter --- src/ButtonThread.cpp | 2 +- src/graphics/Screen.cpp | 8 +++----- src/modules/Telemetry/EnvironmentTelemetry.cpp | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/ButtonThread.cpp b/src/ButtonThread.cpp index a7d594a77..a6840e5a1 100644 --- a/src/ButtonThread.cpp +++ b/src/ButtonThread.cpp @@ -229,7 +229,7 @@ int32_t ButtonThread::runOnce() sendAdHocPosition(); // Show temporary on-screen confirmation banner for 3 seconds - screen->showOverlayBanner("Ad-hoc Position Sent", 3000); + screen->showOverlayBanner("Ad-hoc Ping Sent", 3000); break; } diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 609f7a51c..ee44d77cc 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -297,7 +297,6 @@ static void drawWelcomeScreen(OLEDDisplay *display, OLEDDisplayUiState *state, i esp_task_wdt_reset(); #endif } - // ============================== // Overlay Alert Banner Renderer // ============================== @@ -319,8 +318,7 @@ static void drawAlertBannerOverlay(OLEDDisplay *display, OLEDDisplayUiState *sta if (alertBannerMessage.length() == 0 || millis() > alertBannerUntil) return; // === Layout Configuration === - constexpr uint16_t padding = 5; // Padding around the text - constexpr uint8_t imprecision = 3; // Pixel jitter to reduce burn-in on E-Ink + constexpr uint16_t padding = 5; // Padding around the text // Setup font and alignment display->setFont(FONT_SMALL); @@ -331,8 +329,8 @@ static void drawAlertBannerOverlay(OLEDDisplay *display, OLEDDisplayUiState *sta uint16_t boxWidth = padding * 2 + textWidth; uint16_t boxHeight = FONT_HEIGHT_SMALL + padding * 2; - int16_t boxLeft = (display->width() / 2) - (boxWidth / 2) + random(-imprecision, imprecision + 1); - int16_t boxTop = (display->height() / 2) - (boxHeight / 2) + random(-imprecision, imprecision + 1); + int16_t boxLeft = (display->width() / 2) - (boxWidth / 2); + int16_t boxTop = (display->height() / 2) - (boxHeight / 2); // === Draw background box === display->setColor(BLACK); diff --git a/src/modules/Telemetry/EnvironmentTelemetry.cpp b/src/modules/Telemetry/EnvironmentTelemetry.cpp index d159f47be..c4581c6a1 100644 --- a/src/modules/Telemetry/EnvironmentTelemetry.cpp +++ b/src/modules/Telemetry/EnvironmentTelemetry.cpp @@ -418,7 +418,7 @@ void EnvironmentTelemetryModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiSt uint32_t now = millis(); bool isOwnTelemetry = lastMeasurementPacket->from == nodeDB->getNodeNum(); - bool isIAQAlert = m.iaq > 100 && (now - lastAlertTime > 60000); + bool isIAQAlert = m.iaq > 200 && (now - lastAlertTime > 60000); if (isOwnTelemetry && isIAQAlert) { LOG_INFO("drawFrame: IAQ %d (own) — showing banner", m.iaq);