Merge IoTThinks PowerSaving-v17 into keymindCascade

Integrate PowerSaving-v17 through a27e78e4 (six new commits).
Use its 10-minute awake / 30-minute asleep companion GPS profile and
separate requested GPS state from receiver power in CLI diagnostics.
Include its nRF52 sensor debug-console settle delay and debug option.

Resolve overlapping GPS v2 changes using the current sensor callbacks,
which already implement live power-saving transitions, user-off control,
telemetry acquisition, wrap-safe sleep/wake timers and retained Airoha
RTC backup. Preserve preference persistence, telemetry cache/holds and
UART/shared-rail ownership safeguards across all four GPS drivers.

Add a compiled production GPS status regression test and run it in CI.
Validated 23 native GPS/power tests, preference and nRF52 pin contracts,
and firmware builds for T1000-E BLE Companion, MeshTracker X1 USB
Companion, Heltec Tracker Repeater, Mesh Solar Room and RAK4631 Sensor.
This commit is contained in:
mikecarper committed 2026-09-30 15:51:07 -07:00
commit 304e5e6df3
6 files changed
+117 -14

No files matched your search

+10 -12
View File
@@ -3057,18 +3057,21 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, char* command, char* re
const char* gps_setting = _sensors->getSettingByKey("gps");
bool active = gps_setting != NULL && strcmp(gps_setting, "1") == 0;
if (_prefs->powersaving_enabled && l->getGPSPowerSaving()) { // GPS Power Saving
if (!active) {
snprintf(reply, 160, "off, %s", enabled ? "powered" : "unpowered");
} else if (_prefs->powersaving_enabled && l->getGPSPowerSaving()) { // GPS Power Saving
unsigned long now = millis();
unsigned long next_off = l->getNextGPSOff();
unsigned long deadline = next_off != 0 ? next_off : l->getNextGPSOn();
long remaining_ms = deadline == 0 ? 0 : (long)(deadline - now);
unsigned long mins = remaining_ms > 0 ? (unsigned long)remaining_ms / 60000UL : 0;
if (next_off != 0) {
snprintf(reply, 160, "on (powersaving, sleep in %luh %lum), %s, %s, %d sats",
mins / 60UL, mins % 60UL, active ? "active" : "deactivated",
snprintf(reply, 160, "on, %s (powersaving, sleep in %luh %lum), %s, %d sats",
enabled ? "powered" : "unpowered", mins / 60UL, mins % 60UL,
fix ? "fix" : "no fix", sats);
} else {
snprintf(reply, 160, "off (powersaving, wake in %luh %lum)", mins / 60UL, mins % 60UL);
snprintf(reply, 160, "on, %s (powersaving, wake in %luh %lum)",
enabled ? "powered" : "unpowered", mins / 60UL, mins % 60UL);
}
// "last sync" from GPS
@@ -3082,14 +3085,9 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, char* command, char* re
dt.hour(), dt.minute(), dt.day(), dt.month(), dt.year());
}
} else { // Normal mode
if (enabled) {
sprintf(reply, "on, %s, %s, %d sats",
active?"active":"deactivated",
fix?"fix":"no fix",
sats);
} else {
strcpy(reply, "off");
}
snprintf(reply, 160, "on, %s, %s, %d sats",
enabled ? "powered" : "unpowered",
fix ? "fix" : "no fix", sats);
}
} else {
strcpy(reply, "Can't find GPS");