mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-20 01:32:40 +00:00
refactor and avoid needless probe (#2799)
* Use UINT32_MAX to indicate no configured GPS * Refactor GPS to not probe if pins not defined * Minor cleanups related to rework * Use Named Constructor to clean up code * Actually disable the GPS thread * Don't actually disable the GPS thread * Move doGPSPowerSave to GPS class * Make sure to set GPS awake on triple-click --------- Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
@@ -165,13 +165,15 @@ class ButtonThread : public concurrency::OSThread
|
||||
static void userButtonMultiPressed()
|
||||
{
|
||||
#if defined(GPS_POWER_TOGGLE)
|
||||
if (config.position.gps_enabled) {
|
||||
LOG_DEBUG("Flag set to false for gps power\n");
|
||||
} else {
|
||||
LOG_DEBUG("Flag set to true to restore power\n");
|
||||
if (gps != nullptr) {
|
||||
if (config.position.gps_enabled) {
|
||||
LOG_DEBUG("Flag set to false for gps power\n");
|
||||
} else {
|
||||
LOG_DEBUG("Flag set to true to restore power\n");
|
||||
}
|
||||
config.position.gps_enabled = !(config.position.gps_enabled);
|
||||
gps->doGPSpowersave(config.position.gps_enabled);
|
||||
}
|
||||
config.position.gps_enabled = !(config.position.gps_enabled);
|
||||
doGPSpowersave(config.position.gps_enabled);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user