mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-21 18:22:32 +00:00
Remove extraneous flag, use gps_enabled. Ensure factory reset is not triggered while chip is off and gps_enabled=0
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
#include "configuration.h"
|
||||
#include "graphics/Screen.h"
|
||||
#include "power.h"
|
||||
#include "GPS.h"
|
||||
#include <OneButton.h>
|
||||
|
||||
namespace concurrency
|
||||
@@ -164,7 +163,7 @@ class ButtonThread : public concurrency::OSThread
|
||||
digitalWrite(PIN_EINK_EN, digitalRead(PIN_EINK_EN) == LOW);
|
||||
#endif
|
||||
#if defined(GPS_POWER_TOGGLE)
|
||||
if(gps->gpsPowerflag)
|
||||
if(config.position.gps_enabled)
|
||||
{
|
||||
DEBUG_MSG("Flag set to false for gps power\n");
|
||||
}
|
||||
@@ -172,8 +171,8 @@ class ButtonThread : public concurrency::OSThread
|
||||
{
|
||||
DEBUG_MSG("Flag set to true to restore power\n");
|
||||
}
|
||||
gps->gpsPowerflag = !(gps->gpsPowerflag);
|
||||
doGPSpowersave(gps->gpsPowerflag);
|
||||
config.position.gps_enabled = !(config.position.gps_enabled);
|
||||
doGPSpowersave(config.position.gps_enabled);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user