mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-11-02 19:02:00 +00:00
feat(l2): Gallery app (screenshots as thumbnails, full view with swipe and delete, the saved trails), the clock from NTP while WiFi is up (the router's server from DHCP first), tabs switch on release, Home apps out of Settings
- Gallery: thumbnails 30 to a page, built only while the screen is still (a decode held the loop and a scroll read as a tap) - segmented(): CLICK_TRIG, so a swipe starting on a screen's tabs doesn't switch them - Settings > Device > Home apps removed (hold an app on Home instead) - platformio.ini: a note that the L2 has no microphone on GPIO15 (verified on hardware) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -319,3 +319,28 @@ void UITask::wifiSave() {
|
||||
snprintf(msg, sizeof(msg), LV_SYMBOL_REFRESH " Connecting to %s...", s_wifi_test_ssid);
|
||||
wifiTestShow(msg, nullptr, nullptr);
|
||||
}
|
||||
|
||||
// From loop(), any screen, once a second: SNTP runs while WiFi is connected
|
||||
// (Settings > WiFi, a map download, an update, the app over WiFi), and each
|
||||
// time it answers the clock takes the time -- ahead or behind, as from GPS.
|
||||
// The first answer of a connection says so when it moved the clock.
|
||||
void UITask::wifiClockTick() {
|
||||
static uint32_t next_ms = 0;
|
||||
static bool first = false;
|
||||
if ((int32_t)(millis() - next_ms) < 0) return;
|
||||
next_ms = millis() + 1000;
|
||||
const bool up = lvport::netRadio() == lvport::NET_UP;
|
||||
if (up != _ntp_on) {
|
||||
_ntp_on = up;
|
||||
if (up) lvport::ntpStart(); else lvport::ntpStop();
|
||||
first = up;
|
||||
}
|
||||
const uint32_t t = lvport::ntpTake();
|
||||
if (t > 1700000000UL) {
|
||||
const uint32_t now = rtc_clock.getCurrentTime();
|
||||
const bool moved = t > now + 1 || now > t + 1;
|
||||
if (moved) rtc_clock.setCurrentTime(t);
|
||||
if (first && moved && !_asleep) showToast("Clock set from the network");
|
||||
first = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user