From 45aebd5bfe5017d15ac381b8e5455e4e60b8f3a7 Mon Sep 17 00:00:00 2001 From: pelgraine <140762863+pelgraine@users.noreply.github.com> Date: Sat, 18 Jul 2026 18:47:27 +1000 Subject: [PATCH] T-Watch S3 - watch alarm screen and associated diagnostic build removed due to power drain issue --- examples/companion_radio/main.cpp | 17 +-------- examples/companion_radio/ui-new/HomeIcons.h | 6 --- examples/companion_radio/ui-new/UITask.cpp | 41 +-------------------- examples/companion_radio/ui-new/UITask.h | 12 ------ variants/lilygo_twatch_s3/platformio.ini | 39 +------------------- 5 files changed, 4 insertions(+), 111 deletions(-) diff --git a/examples/companion_radio/main.cpp b/examples/companion_radio/main.cpp index 8c9a1a58..5ab409c8 100644 --- a/examples/companion_radio/main.cpp +++ b/examples/companion_radio/main.cpp @@ -1125,9 +1125,6 @@ static uint32_t _atoi(const char* sp) { /* GLOBAL OBJECTS */ #ifdef DISPLAY_CLASS #include "UITask.h" - #if defined(LILYGO_TWATCH_S3) - #include "WatchAlarmScreen.h" // After UITask.h -- needs NodePrefs - #endif #if defined(MECK_TWATCH) #include "WatchNotesScreen.h" // After UITask.h -- needs NodePrefs #include "WatchChannelConfigScreen.h" // After UITask.h -- needs NodePrefs, the_mesh @@ -1368,16 +1365,6 @@ static void lastHeardToggleContact() { return 0; } #endif -#if defined(LILYGO_TWATCH_S3) - // Alarm screen: rows, +/- steppers and the footer are all tap targets. - // readTouch() already returns logical (UI_ZOOM-divided) coords on the watch, - // which is the space WatchAlarmScreen lays out in. No further scaling. - if (ui_task.isOnWatchAlarmScreen()) { - WatchAlarmScreen* wa = (WatchAlarmScreen*)ui_task.getWatchAlarmScreen(); - if (wa) wa->handleTap(x, y); - return 0; - } -#endif #if defined(MECK_TWATCH) // Notes screen: list rows, view scroll zones and the footer are all tap // targets, in the same logical coords as the alarm screen. @@ -1958,8 +1945,8 @@ static void lastHeardToggleContact() { if (row == 1 && col == 1) { ui_task.gotoDiscoveryScreen(); return 0; } if (row == 2 && col == 0) { ui_task.gotoTraceScreen(); return 0; } #if defined(LILYGO_TWATCH_S3) - // No GNSS on the plain S3, so this slot is the vibrate alarm clock. - if (row == 2 && col == 1) { ui_task.gotoWatchAlarmScreen(); return 0; } + // No GNSS on the plain S3, so this slot is the games launcher. + if (row == 2 && col == 1) { ui_task.gotoGamesMenu(); return 0; } #elif HAS_GPS if (row == 2 && col == 1) { // Maps: mark the tile FS ready (detectZoomRange in enter() needs it) diff --git a/examples/companion_radio/ui-new/HomeIcons.h b/examples/companion_radio/ui-new/HomeIcons.h index 85d0f9eb..ec95dd0f 100644 --- a/examples/companion_radio/ui-new/HomeIcons.h +++ b/examples/companion_radio/ui-new/HomeIcons.h @@ -48,12 +48,6 @@ static const uint8_t icon_search[] PROGMEM = { 0x3C,0x00, 0x03,0x00, 0x01,0x80, 0x00,0xC0, 0x00,0x40, 0x00,0x00, }; -// ⏰ Alarm Clock (AlarmScreen) -- 12x12 home tile icon -static const uint8_t icon_alarm[] PROGMEM = { - 0x40,0x40, 0x9E,0x20, 0x20,0x80, 0x44,0x40, 0x44,0x40, 0x46,0x40, - 0x40,0x40, 0x20,0x80, 0x1F,0x00, 0x00,0x00, 0x20,0x40, 0x40,0x20, -}; - // Mountain (Maps) static const uint8_t icon_map[] PROGMEM = { 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x08,0x00, 0x14,0x00, 0x22,0x40, diff --git a/examples/companion_radio/ui-new/UITask.cpp b/examples/companion_radio/ui-new/UITask.cpp index f6f1bfcc..cda13329 100644 --- a/examples/companion_radio/ui-new/UITask.cpp +++ b/examples/companion_radio/ui-new/UITask.cpp @@ -79,9 +79,6 @@ #if defined(MECK_TWATCH) #include // step history persistence (the "maps" partition) #endif -#if defined(LILYGO_TWATCH_S3) -#include "WatchAlarmScreen.h" -#endif #if defined(MECK_TWATCH) #include "WatchNotesScreen.h" // After UITask.h -- needs NodePrefs #include "WatchChannelConfigScreen.h" // After UITask.h -- needs NodePrefs, the_mesh @@ -704,7 +701,7 @@ public: { {icon_envelope, "Messages", 0x0CB1}, {icon_people, "Contacts", 0xCAA0} }, { {icon_gear, "Settings", 0x0560}, {icon_search, "Discover", 0xF81F} }, #if defined(LILYGO_TWATCH_S3) - { {icon_trace, "Trace", 0xF800}, {icon_alarm, "Alarms", 0x231D} }, + { {icon_trace, "Trace", 0xF800}, {icon_gamepad, "Games", 0x231D} }, #else { {icon_trace, "Trace", 0xF800}, {icon_map, "Maps", 0x231D} }, #endif @@ -1791,11 +1788,6 @@ void UITask::begin(DisplayDriver* display, SensorManager* sensors, NodePrefs* no // LittleFS ("/maps" partition) is mounted in setup() before UITask::begin(). loadSteps(); #endif -#if defined(LILYGO_TWATCH_S3) - // LittleFS ("/maps" partition) is mounted in setup() before UITask::begin(). - watch_alarm_screen = new WatchAlarmScreen(this, &rtc_clock, node_prefs); - ((WatchAlarmScreen*)watch_alarm_screen)->load(); -#endif #if defined(MECK_TWATCH) // LittleFS ("/maps" partition) is mounted in setup() before UITask::begin(). watch_notes_screen = new WatchNotesScreen(this, &rtc_clock, node_prefs); @@ -2511,25 +2503,6 @@ void UITask::loop() { if (buzzer.isPlaying()) buzzer.loop(); #endif -#if defined(LILYGO_TWATCH_S3) && !defined(MECK_DIAG_NO_ALARM) - // Alarms are checked every loop, not from the screen's poll(), so one fires - // with the display off or another screen showing. - if (watch_alarm_screen) { - WatchAlarmScreen* wa = (WatchAlarmScreen*)watch_alarm_screen; - bool fired = wa->tick(); - if (fired || wa->isRinging()) { - // Hold the screen and the display for the whole ring. Without this the - // display auto-offs after AUTO_OFF_MILLIS, the buzzing trips the BMA423 - // tilt detector, and raise-to-wake below swaps in the clock screen. It - // also guarantees the PWR key reaches handleInput() as KEY_ENTER rather - // than being consumed by checkDisplayOn() as a wake. - if (curr != watch_alarm_screen) setCurrScreen(watch_alarm_screen); - if (_display != NULL && !_display->isOn()) _display->turnOn(); - _auto_off = millis() + AUTO_OFF_MILLIS; - if (fired) _next_refresh = 0; - } - } -#endif if (curr) curr->poll(); @@ -4053,18 +4026,6 @@ void UITask::gotoStepsHistoryScreen() { } #endif -#if defined(LILYGO_TWATCH_S3) -void UITask::gotoWatchAlarmScreen() { - WatchAlarmScreen* wa = (WatchAlarmScreen*)watch_alarm_screen; - if (wa) wa->enter(); - setCurrScreen(watch_alarm_screen); - if (_display != NULL && !_display->isOn()) { - _display->turnOn(); - } - _auto_off = millis() + AUTO_OFF_MILLIS; - _next_refresh = 100; -} -#endif void UITask::gotoGamesMenu() { GamesMenuScreen* gm = (GamesMenuScreen*)games_menu_screen; diff --git a/examples/companion_radio/ui-new/UITask.h b/examples/companion_radio/ui-new/UITask.h index 439c5b47..2315adaa 100644 --- a/examples/companion_radio/ui-new/UITask.h +++ b/examples/companion_radio/ui-new/UITask.h @@ -139,9 +139,6 @@ class UITask : public AbstractUITask { void rollStepDays(int32_t newDay); void shiftStepHistory(uint32_t completedDay); #endif -#if defined(LILYGO_TWATCH_S3) - UIScreen* watch_alarm_screen; // Vibrate-only alarm clock (no audio hardware) -#endif #if defined(MECK_TWATCH) UIScreen* watch_notes_screen; // LittleFS note pad (shared NotesScreen needs SD) UIScreen* watch_channel_cfg_screen; // Per-channel region/notif/delete (touch UI) @@ -253,9 +250,6 @@ public: uint32_t getTodaySteps(); // Steps accumulated today uint32_t getStepHistory(int daysAgo); // 0 = today, 1..6 = previous days #endif -#if defined(LILYGO_TWATCH_S3) - void gotoWatchAlarmScreen(); // Navigate to the vibrate alarm clock -#endif #if HAS_GPS void gotoMapScreen(); // Navigate to map tile screen #endif @@ -321,9 +315,6 @@ public: bool isOnStepsScreen() const { return curr == steps_screen; } bool isOnStepsHistoryScreen() const { return curr == steps_history_screen; } #endif -#if defined(LILYGO_TWATCH_S3) - bool isOnWatchAlarmScreen() const { return curr == watch_alarm_screen; } -#endif #if defined(MECK_TWATCH) bool isOnWatchNotesScreen() const { return curr == watch_notes_screen; } bool isOnWatchChannelConfigScreen() const { return curr == watch_channel_cfg_screen; } @@ -427,9 +418,6 @@ public: UIScreen* getStepsScreen() const { return steps_screen; } UIScreen* getStepsHistoryScreen() const { return steps_history_screen; } #endif -#if defined(LILYGO_TWATCH_S3) - UIScreen* getWatchAlarmScreen() const { return watch_alarm_screen; } -#endif #if defined(MECK_TWATCH) UIScreen* getWatchNotesScreen() const { return watch_notes_screen; } UIScreen* getWatchChannelConfigScreen() const { return watch_channel_cfg_screen; } diff --git a/variants/lilygo_twatch_s3/platformio.ini b/variants/lilygo_twatch_s3/platformio.ini index 7c3bf694..0feae813 100644 --- a/variants/lilygo_twatch_s3/platformio.ini +++ b/variants/lilygo_twatch_s3/platformio.ini @@ -137,41 +137,4 @@ lib_deps = densaugeo/base64 @ ~1.4.0 lib_ignore = AsyncTCP - ESPAsyncWebServer - -; --------------------------------------------------------------------------- -; TEMP DIAGNOSTIC BUILD -- power-drain bisect (remove when concluded). -; The S3 standalone firmware with the per-loop WatchAlarmScreen tick() disabled, -; gated by MECK_DIAG_NO_ALARM: the alarm-check block in UITask::loop is compiled -; out, so localNow() (an RTC read) and the slot scan no longer run every loop. -; The alarm screen is still created and menu-reachable, but no alarm can fire on -; this build by design. Run the same wear test as the standalone S3 build; a -; materially slower drain implicates the alarm tick() in the S3-only excess. -; Revert: delete this env and grep MECK_DIAG_NO_ALARM (one block in UITask.cpp). -; Flash: pio run -e meck_twatch_s3_diag_noalarm -t upload -; --------------------------------------------------------------------------- -[env:meck_twatch_s3_diag_noalarm] -extends = LilyGo_TWatchS3 -build_flags = - ${LilyGo_TWatchS3.build_flags} - -I examples/companion_radio/ui-new - -D MAX_CONTACTS=2000 - -D MAX_GROUP_CHANNELS=40 - -D OFFLINE_QUEUE_SIZE=1 - -D ESP32_CPU_FREQ=80 - -D MECK_DIAG_NO_ALARM - -D FIRMWARE_VERSION='"Meck TWatch S3 DiagNoAlarm v0.3"' -build_src_filter = ${LilyGo_TWatchS3.build_src_filter} - + - - - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> - + -lib_deps = - ${LilyGo_TWatchS3.lib_deps} - densaugeo/base64 @ ~1.4.0 -lib_ignore = - AsyncTCP - ESPAsyncWebServer - ESP32 BLE Arduino \ No newline at end of file + ESPAsyncWebServer \ No newline at end of file