diff --git a/docs/software/gps-todo.txt b/docs/software/gps-todo.txt index 872fd922..4cda7dac 100644 --- a/docs/software/gps-todo.txt +++ b/docs/software/gps-todo.txt @@ -3,14 +3,8 @@ gps todo - bug 376 for taiwan region: bin/run.sh --set region 8 -fix poll interval for sending commands to ublox - change defaults to 2 min -properly handle time only modes - -force gps sleep when in LightSleep and force wake only once <- confirm - fix has_gps based on new logic have loop methods return allowable sleep time (from their perspective) diff --git a/proto b/proto index 0d4ad90e..aa018c38 160000 --- a/proto +++ b/proto @@ -1 +1 @@ -Subproject commit 0d4ad90e4aca509e942e1dacdb947076dc01e2ab +Subproject commit aa018c38de076a7d9e732f2e128c1800b56b1971 diff --git a/src/gps/GPS.cpp b/src/gps/GPS.cpp index f8d83743..29f9d6bb 100644 --- a/src/gps/GPS.cpp +++ b/src/gps/GPS.cpp @@ -147,10 +147,6 @@ uint32_t GPS::getWakeTime() const { uint32_t t = radioConfig.preferences.gps_attempt_time; - auto op = getGpsOp(); - if ((timeSetFromGPS && op == GpsOperation_GpsOpTimeOnly) || (op == GpsOperation_GpsOpDisabled)) - t = UINT32_MAX; // Sleep forever now - if (t == UINT32_MAX) return t; // already maxint @@ -168,12 +164,15 @@ uint32_t GPS::getSleepTime() const { uint32_t t = radioConfig.preferences.gps_update_interval; + auto op = getGpsOp(); + if ((timeSetFromGPS && op == GpsOperation_GpsOpTimeOnly) || (op == GpsOperation_GpsOpDisabled)) + t = UINT32_MAX; // Sleep forever now + if (t == UINT32_MAX) return t; // already maxint - // fixme check modes if (t == 0) - t = 30; // 2 mins + t = 2 * 60; // 2 mins t *= 1000; @@ -242,7 +241,7 @@ void GPS::loop() void GPS::forceWake(bool on) { if (on) { - DEBUG_MSG("llowing GPS lock\n"); + DEBUG_MSG("Allowing GPS lock\n"); // lastSleepStartMsec = 0; // Force an update ASAP wakeAllowed = true; } else {