mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-03 11:19:58 +00:00
Smart position sends updates too frequently. #956
This commit is contained in:
parent
53efb9c0f6
commit
aaefd2c2e7
@ -127,7 +127,7 @@ int32_t PositionPlugin::runOnce()
|
|||||||
{
|
{
|
||||||
NodeInfo *node = nodeDB.getNode(nodeDB.getNodeNum());
|
NodeInfo *node = nodeDB.getNode(nodeDB.getNodeNum());
|
||||||
|
|
||||||
// radioConfig.preferences.position_broadcast_smart = true;
|
radioConfig.preferences.position_broadcast_smart = true;
|
||||||
|
|
||||||
// We limit our GPS broadcasts to a max rate
|
// We limit our GPS broadcasts to a max rate
|
||||||
uint32_t now = millis();
|
uint32_t now = millis();
|
||||||
@ -164,7 +164,8 @@ int32_t PositionPlugin::runOnce()
|
|||||||
// If the distance traveled since the last update is greater than 100 meters
|
// If the distance traveled since the last update is greater than 100 meters
|
||||||
// and it's been at least 60 seconds since the last update
|
// and it's been at least 60 seconds since the last update
|
||||||
if ((abs(distance) >= distanceTravel) &&
|
if ((abs(distance) >= distanceTravel) &&
|
||||||
(lastGpsSend == 0 || now - timeTravel >= getPref_position_broadcast_secs() * 1000)) {
|
(now - lastGpsSend >= timeTravel * 1000)
|
||||||
|
) {
|
||||||
bool requestReplies = currentGeneration != radioGeneration;
|
bool requestReplies = currentGeneration != radioGeneration;
|
||||||
currentGeneration = radioGeneration;
|
currentGeneration = radioGeneration;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user