mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-02 10:50:40 +00:00
always use gps.isConnected to check for GPS, it is the only thing
guaranteed to be fresh and accurate
This commit is contained in:
parent
cc3bac7ea0
commit
a0c97825e8
@ -151,7 +151,7 @@ void MeshService::handleFromRadio(MeshPacket *mp)
|
||||
mp->rx_time = gps.getValidTime(); // store the arrival timestamp for the phone
|
||||
|
||||
// If it is a position packet, perhaps set our clock (if we don't have a GPS of our own, otherwise wait for that to work)
|
||||
if (!myNodeInfo.has_gps)
|
||||
if (!gps.isConnected)
|
||||
handleIncomingPosition(mp);
|
||||
else {
|
||||
DEBUG_MSG("Ignoring incoming time, because we have a GPS\n");
|
||||
@ -263,7 +263,7 @@ void MeshService::sendToMesh(MeshPacket *p)
|
||||
// nodes shouldn't trust it anyways) Note: for now, we allow a device with a local GPS to include the time, so that gpsless
|
||||
// devices can get time.
|
||||
if (p->has_payload && p->payload.which_variant == SubPacket_position_tag) {
|
||||
if (!myNodeInfo.has_gps) {
|
||||
if (!gps.isConnected) {
|
||||
DEBUG_MSG("Stripping time %u from position send\n", p->payload.variant.position.time);
|
||||
p->payload.variant.position.time = 0;
|
||||
} else
|
||||
|
@ -393,7 +393,7 @@ static void drawDebugInfo(OLEDDisplay *display, OLEDDisplayUiState *state, int16
|
||||
snprintf(batStr, sizeof(batStr), "Batt %x%%", (isCharging << 1) + isUSBPowered);
|
||||
|
||||
static char gpsStr[20];
|
||||
if (myNodeInfo.has_gps)
|
||||
if (gps.isConnected)
|
||||
snprintf(gpsStr, sizeof(gpsStr), "GPS %d%%",
|
||||
75); // FIXME, use something based on hdop
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user