mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-08-06 04:06:12 +00:00
feat: screen lock — hold Back + 3×Enter to lock/unlock
- Long press Back starts lock sequence; 3 Enter presses within 3s toggle lock - Locked screen wakes for 5 seconds on any key, showing clock and unlock hint - Incoming messages do not wake the display while locked - Auto Lock setting in Display section: locks automatically when screen turns off - Lock state persisted in UITask; NodePrefs gains auto_lock flag Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
b068318bc5
commit
9ff42a9296
@@ -10,6 +10,7 @@ class SettingsScreen : public UIScreen {
|
||||
SECTION_DISPLAY,
|
||||
BRIGHTNESS,
|
||||
AUTO_OFF,
|
||||
AUTO_LOCK,
|
||||
BATT_DISPLAY,
|
||||
CLOCK_SECONDS,
|
||||
// Sound section
|
||||
@@ -279,6 +280,10 @@ class SettingsScreen : public UIScreen {
|
||||
display.print("AutoOff");
|
||||
display.setCursor(VAL_X, y);
|
||||
display.print(AUTO_OFF_LABELS[autoOffIndex()]);
|
||||
} else if (item == AUTO_LOCK) {
|
||||
display.print("AutoLock");
|
||||
display.setCursor(VAL_X, y);
|
||||
display.print((p && p->auto_lock) ? "ON" : "OFF");
|
||||
#if ENV_INCLUDE_GPS == 1
|
||||
} else if (item == GPS_INTERVAL) {
|
||||
display.print("GPS upd");
|
||||
@@ -452,6 +457,11 @@ public:
|
||||
if (left) idx = (idx + AUTO_OFF_COUNT - 1) % AUTO_OFF_COUNT;
|
||||
if (left || right) { p->auto_off_secs = AUTO_OFF_OPTS[idx]; _dirty = true; return true; }
|
||||
}
|
||||
if (_selected == AUTO_LOCK && p && (left || right || enter)) {
|
||||
p->auto_lock ^= 1;
|
||||
_dirty = true;
|
||||
return true;
|
||||
}
|
||||
#if ENV_INCLUDE_GPS == 1
|
||||
if (_selected == GPS_INTERVAL && p) {
|
||||
int idx = gpsIntervalIndex();
|
||||
|
||||
Reference in New Issue
Block a user