This commit is contained in:
Ben Meadors 2025-04-22 07:46:54 -05:00
parent 2853323379
commit d47f74dc06

View File

@ -1791,19 +1791,21 @@ bool GPS::whileActive()
} }
void GPS::enable() void GPS::enable()
{ {
LOG_INFO("GPS - enabling"); LOG_INFO("GPS - disabling");
// ensure we are marked as enabled in config // Clear the old scheduling info (reset the lock-time prediction)
config.position.gps_mode = meshtastic_Config_PositionConfig_GpsMode_ENABLED; scheduling.reset();
// Start our thread
setIntervalFromNow(0); // Run right away enabled = true;
shouldPublish = true; setInterval(GPS_THREAD_INTERVAL);
scheduling.informSearching();
setPowerState(GPS_ACTIVE);
} }
int32_t GPS::disable() int32_t GPS::disable()
{ {
LOG_INFO("GPS - disabling"); LOG_INFO("GPS - disabling");
config.position.gps_mode = meshtastic_Config_PositionConfig_GpsMode_DISABLED; enabled = false;
// Clear any resources // Clear any resources
setPowerState(GPS_OFF); setPowerState(GPS_OFF);