mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-08 06:02:05 +00:00
Removed Jitter
This commit is contained in:
parent
0a61ea4137
commit
4e8ae7b108
@ -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;
|
||||
}
|
||||
|
||||
|
@ -297,7 +297,6 @@ static void drawWelcomeScreen(OLEDDisplay *display, OLEDDisplayUiState *state, i
|
||||
esp_task_wdt_reset();
|
||||
#endif
|
||||
}
|
||||
|
||||
// ==============================
|
||||
// Overlay Alert Banner Renderer
|
||||
// ==============================
|
||||
@ -320,7 +319,6 @@ static void drawAlertBannerOverlay(OLEDDisplay *display, OLEDDisplayUiState *sta
|
||||
|
||||
// === 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
|
||||
|
||||
// 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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user