Addressing review comments

This commit is contained in:
jpirnay
2026-03-26 17:34:00 +01:00
parent 2bcfa50a7c
commit 166ce73e2d
5 changed files with 24 additions and 10 deletions
+9 -1
View File
@@ -34,7 +34,13 @@ void SyncTimeActivity::onEnter() {
}
startActivityForResult(std::make_unique<WifiSelectionActivity>(renderer, mappedInput),
[this](const ActivityResult& result) { onWifiSelectionComplete(!result.isCancelled); });
[this](const ActivityResult& result) {
if (result.isCancelled) {
onWifiSelectionCancelled();
return;
}
onWifiSelectionComplete(true);
});
}
void SyncTimeActivity::onExit() {
@@ -58,6 +64,8 @@ void SyncTimeActivity::onWifiSelectionComplete(bool success) {
performSync();
}
void SyncTimeActivity::onWifiSelectionCancelled() { finish(); }
void SyncTimeActivity::performSync() {
bool ok = HalClock::syncNtp();
wifiOff();
+1 -1
View File
@@ -15,7 +15,7 @@ class SyncTimeActivity final : public Activity {
private:
enum State { CONNECTING, SYNCING, SUCCESS, FAILED };
State state = CONNECTING;
void onWifiSelectionComplete(bool success);
void onWifiSelectionCancelled();
void performSync();
};
+1 -1
View File
@@ -185,7 +185,7 @@ void waitForPowerRelease() {
void enterDeepSleep() {
HalPowerManager::Lock powerLock; // Ensure we are at normal CPU frequency for sleep preparation
APP_STATE.lastSleepFromReader = activityManager.isReaderActivity();
HalClock::saveBeforeSleep();
HalClock::saveBeforeSleep(SETTINGS.keepClockAlive);
APP_STATE.saveToFile();
activityManager.goToSleep();