mirror of
https://github.com/pelgraine/Meck.git
synced 2026-08-07 17:22:44 +02:00
T-Watch S3 - watch alarm screen and associated diagnostic build removed due to power drain issue
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -79,9 +79,6 @@
|
||||
#if defined(MECK_TWATCH)
|
||||
#include <LittleFS.h> // 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;
|
||||
|
||||
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user