Skip to content

Commit

Permalink
bug meshtastic#376 - wip time only mode now works
Browse files Browse the repository at this point in the history
  • Loading branch information
geeksville committed Oct 5, 2020
1 parent f6861a8 commit ef146fc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
6 changes: 0 additions & 6 deletions docs/software/gps-todo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion proto
Submodule proto updated from 0d4ad9 to aa018c
13 changes: 6 additions & 7 deletions src/gps/GPS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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;

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit ef146fc

Please sign in to comment.