diff --git a/examples/companion_radio/MyMesh.cpp b/examples/companion_radio/MyMesh.cpp index 4e43de86..f168bdce 100644 --- a/examples/companion_radio/MyMesh.cpp +++ b/examples/companion_radio/MyMesh.cpp @@ -952,6 +952,9 @@ MyMesh::MyMesh(mesh::Radio &radio, mesh::RNG &rng, mesh::RTCClock &rtc, SimpleMe _prefs.dm_show_all = 1; // show all contacts by default memset(_prefs.dm_notif, 0, sizeof(_prefs.dm_notif)); _prefs.auto_off_secs = 15; // 15 seconds auto-off by default +#ifdef EINK_DISPLAY_MODEL + _prefs.clock_hide_seconds = 1; // e-ink: seconds cause a panel refresh every second +#endif _prefs.tz_offset_hours = 0; // UTC by default _prefs.low_batt_mv = 3400; // auto-shutdown at 3.4V by default _prefs.batt_display_mode = 0; // icon by default diff --git a/examples/companion_radio/ui-new/SettingsScreen.h b/examples/companion_radio/ui-new/SettingsScreen.h index 93f08fdd..2c18ddf3 100644 --- a/examples/companion_radio/ui-new/SettingsScreen.h +++ b/examples/companion_radio/ui-new/SettingsScreen.h @@ -12,7 +12,9 @@ class SettingsScreen : public UIScreen { AUTO_OFF, AUTO_LOCK, BATT_DISPLAY, +#if !defined(EINK_DISPLAY_MODEL) CLOCK_SECONDS, +#endif CLOCK_FORMAT, FONT, #if defined(EINK_DISPLAY_MODEL) @@ -312,10 +314,12 @@ class SettingsScreen : public UIScreen { display.setCursor(VAL_X, y); uint8_t mode = p ? p->batt_display_mode : 0; display.print(BATT_DISPLAY_LABELS[mode < BATT_DISPLAY_COUNT ? mode : 0]); +#if !defined(EINK_DISPLAY_MODEL) } else if (item == CLOCK_SECONDS) { display.print("Seconds"); display.setCursor(VAL_X, y); display.print((p && p->clock_hide_seconds) ? "OFF" : "ON"); +#endif } else if (item == CLOCK_FORMAT) { display.print("Format"); display.setCursor(VAL_X, y); @@ -512,11 +516,13 @@ public: if (left) idx = (idx + BATT_DISPLAY_COUNT - 1) % BATT_DISPLAY_COUNT; if (left || right) { p->batt_display_mode = idx; _dirty = true; return true; } } +#if !defined(EINK_DISPLAY_MODEL) if (_selected == CLOCK_SECONDS && p && (left || right || enter)) { p->clock_hide_seconds ^= 1; _dirty = true; return true; } +#endif if (_selected == CLOCK_FORMAT && p && (left || right || enter)) { p->clock_12h ^= 1; _dirty = true; diff --git a/examples/companion_radio/ui-new/UITask.cpp b/examples/companion_radio/ui-new/UITask.cpp index b081b577..01b1620f 100644 --- a/examples/companion_radio/ui-new/UITask.cpp +++ b/examples/companion_radio/ui-new/UITask.cpp @@ -692,11 +692,16 @@ public: } } bool auto_adv = _node_prefs && _node_prefs->advert_auto_interval_sec > 0; +#ifdef EINK_DISPLAY_MODEL + if (_page == HomePage::CLOCK) return 60000; // no seconds on e-ink; content changes at most every minute + return 30000; // e-ink: limit base polling; new messages still force immediate refresh via notify() +#else if (_page == HomePage::CLOCK) { bool show_sec = !_node_prefs || !_node_prefs->clock_hide_seconds; return auto_adv ? 1000 : (show_sec ? 1000 : 60000); } return auto_adv ? 1000 : 5000; +#endif } bool handleInput(char c) override { @@ -1399,7 +1404,11 @@ void UITask::loop() { _display->setCursor(hx, hy); _display->print(hint); _display->endFrame(); +#ifdef EINK_DISPLAY_MODEL + _next_refresh = millis() + 60000; +#else _next_refresh = millis() + 1000; +#endif } else if (!_locked && millis() >= _next_refresh && curr) { _display->startFrame(); int delay_millis = curr->render(*_display);