Skip to content

Commit

Permalink
Fix displays showing "GPS Not Present" until first lock
Browse files Browse the repository at this point in the history
meshtastic#5160 introduced a change
which made first publication of GPS information take up to 15mins.
For that initial period, displays would show "No GPS Present", even
if one was detected.

This change fixes that bug, triggering publication immediately after
a GPS module is detected.
  • Loading branch information
fifieldt committed Nov 3, 2024
1 parent bee474e commit 63a279a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/gps/GPS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,8 @@ bool GPS::setup()
if (++speedSelect == sizeof(serialSpeeds) / sizeof(int)) {
speedSelect = 0;
++probeTries;
} else {
return false;
}
}
}
Expand All @@ -444,13 +446,15 @@ bool GPS::setup()
if (++speedSelect == sizeof(rareSerialSpeeds) / sizeof(int)) {
LOG_WARN("Giving up on GPS probe and setting to %d", GPS_BAUDRATE);
return true;
} else {
return false;
}
}
}
return false;
}

} else {
gnssModel = GNSS_MODEL_UNKNOWN;
if (gnssModel != GNSS_MODEL_UNKNOWN) {
setConnected();
}

if (gnssModel == GNSS_MODEL_MTK) {
Expand Down Expand Up @@ -1009,6 +1013,7 @@ int32_t GPS::runOnce()
}
}
GPSInitFinished = true;
publishUpdate();
}

// Repeaters have no need for GPS
Expand Down

0 comments on commit 63a279a

Please sign in to comment.