Skip to content

Commit

Permalink
Merge branch 'meshtastic:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Mictronics authored Jan 7, 2024
2 parents 7b8fd4e + ea651c2 commit 9afad9a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
5 changes: 3 additions & 2 deletions src/gps/GPS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -596,11 +596,12 @@ void GPS::setAwake(bool on)
*/
uint32_t GPS::getWakeTime() const
{
uint32_t t = config.position.gps_attempt_time;
uint32_t t = config.position.position_broadcast_secs;

if (t == UINT32_MAX)
return t; // already maxint
return t * 1000;

return getConfiguredOrDefaultMs(t, default_broadcast_interval_secs);
}

/** Get how long we should sleep between aqusition attempts in msecs
Expand Down
2 changes: 1 addition & 1 deletion src/gps/GPS.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class GPS : private concurrency::OSThread

/**
* hasValidLocation - indicates that the position variables contain a complete
* GPS location, valid and fresh (< gps_update_interval + gps_attempt_time)
* GPS location, valid and fresh (< gps_update_interval + position_broadcast_secs)
*/
bool hasValidLocation = false; // default to false, until we complete our first read

Expand Down
3 changes: 0 additions & 3 deletions src/mesh/NodeDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ void NodeDB::installDefaultConfig()
void NodeDB::initConfigIntervals()
{
config.position.gps_update_interval = default_gps_update_interval;
config.position.gps_attempt_time = default_gps_attempt_time;
config.position.position_broadcast_secs = default_broadcast_interval_secs;

config.power.ls_secs = default_ls_secs;
Expand Down Expand Up @@ -301,8 +300,6 @@ void NodeDB::installRoleDefaults(meshtastic_Config_DeviceConfig_Role role)
initModuleConfigIntervals();
} else if (role == meshtastic_Config_DeviceConfig_Role_REPEATER) {
config.display.screen_on_secs = 1;
} else if (role == meshtastic_Config_DeviceConfig_Role_TRACKER) {
config.position.gps_update_interval = 30;
} else if (role == meshtastic_Config_DeviceConfig_Role_SENSOR) {
moduleConfig.telemetry.environment_measurement_enabled = true;
moduleConfig.telemetry.environment_update_interval = 300;
Expand Down
4 changes: 0 additions & 4 deletions src/mesh/NodeDB.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,6 @@ extern NodeDB nodeDB;
prefs.gps_update_interval = oneday
prefs.is_power_saving = True
# allow up to five minutes for each new GPS lock attempt
prefs.gps_attempt_time = 300
*/

// Our delay functions check for this for times that should never expire
Expand All @@ -192,7 +189,6 @@ extern NodeDB nodeDB;

#define ONE_DAY 24 * 60 * 60

#define default_gps_attempt_time IF_ROUTER(5 * 60, 15 * 60)
#define default_gps_update_interval IF_ROUTER(ONE_DAY, 2 * 60)
#define default_broadcast_interval_secs IF_ROUTER(ONE_DAY / 2, 15 * 60)
#define default_wait_bluetooth_secs IF_ROUTER(1, 60)
Expand Down

0 comments on commit 9afad9a

Please sign in to comment.