mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-12 23:51:25 +00:00
Publish fixed position updates and consider changes in only altitude as an updated point (#3758)
* AdminModule: Publish fixed position updates Enabled GPS thread when fixed position is updated, to let the GPS thread run once and publish the new fixed position. Signed-off-by: Andrew Yong <me@ndoo.sg> * GPS: Consider changes in only altitude as an updated point Signed-off-by: Andrew Yong <me@ndoo.sg> --------- Signed-off-by: Andrew Yong <me@ndoo.sg>
This commit is contained in:
parent
4f54862d63
commit
5f929a8024
@ -1467,7 +1467,7 @@ bool GPS::lookForLocation()
|
|||||||
#endif // GPS_EXTRAVERBOSE
|
#endif // GPS_EXTRAVERBOSE
|
||||||
|
|
||||||
// Is this a new point or are we re-reading the previous one?
|
// Is this a new point or are we re-reading the previous one?
|
||||||
if (!reader.location.isUpdated())
|
if (!reader.location.isUpdated() && !reader.altitude.isUpdated())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// check if a complete GPS solution set is available for reading
|
// check if a complete GPS solution set is available for reading
|
||||||
|
@ -23,6 +23,10 @@
|
|||||||
#include "mqtt/MQTT.h"
|
#include "mqtt/MQTT.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !MESHTASTIC_EXCLUDE_GPS
|
||||||
|
#include "GPS.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
AdminModule *adminModule;
|
AdminModule *adminModule;
|
||||||
bool hasOpenEditTransaction;
|
bool hasOpenEditTransaction;
|
||||||
|
|
||||||
@ -217,6 +221,10 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
|
|||||||
nodeDB->setLocalPosition(r->set_fixed_position);
|
nodeDB->setLocalPosition(r->set_fixed_position);
|
||||||
config.position.fixed_position = true;
|
config.position.fixed_position = true;
|
||||||
saveChanges(SEGMENT_DEVICESTATE | SEGMENT_CONFIG, false);
|
saveChanges(SEGMENT_DEVICESTATE | SEGMENT_CONFIG, false);
|
||||||
|
#if !MESHTASTIC_EXCLUDE_GPS
|
||||||
|
if (gps != nullptr)
|
||||||
|
gps->enable();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user