mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-25 17:42:48 +00:00
Experiment with moving gps init (#2780)
* Move it move it * Moving to the end of the main setup method * NimBLE version
This commit is contained in:
parent
dcdf9b64de
commit
fcf798df98
@ -38,7 +38,7 @@ lib_deps =
|
|||||||
${networking_base.lib_deps}
|
${networking_base.lib_deps}
|
||||||
${environmental_base.lib_deps}
|
${environmental_base.lib_deps}
|
||||||
https://github.com/meshtastic/esp32_https_server.git#23665b3adc080a311dcbb586ed5941b5f94d6ea2
|
https://github.com/meshtastic/esp32_https_server.git#23665b3adc080a311dcbb586ed5941b5f94d6ea2
|
||||||
h2zero/NimBLE-Arduino@^1.4.0
|
h2zero/NimBLE-Arduino@^1.4.1
|
||||||
jgromes/RadioLib@^6.1.0
|
jgromes/RadioLib@^6.1.0
|
||||||
https://github.com/lewisxhe/XPowersLib.git#84b7373faea3118b6c37954d52f98b8a337148d6
|
https://github.com/lewisxhe/XPowersLib.git#84b7373faea3118b6c37954d52f98b8a337148d6
|
||||||
https://github.com/meshtastic/ESP32_Codec2.git#633326c78ac251c059ab3a8c430fcdf25b41672f
|
https://github.com/meshtastic/ESP32_Codec2.git#633326c78ac251c059ab3a8c430fcdf25b41672f
|
||||||
|
42
src/main.cpp
42
src/main.cpp
@ -558,17 +558,6 @@ void setup()
|
|||||||
|
|
||||||
readFromRTC(); // read the main CPU RTC at first (in case we can't get GPS time)
|
readFromRTC(); // read the main CPU RTC at first (in case we can't get GPS time)
|
||||||
|
|
||||||
gps = createGps();
|
|
||||||
|
|
||||||
if (gps) {
|
|
||||||
gpsStatus->observe(&gps->newStatus);
|
|
||||||
if (config.position.gps_enabled == false && config.position.fixed_position == false) {
|
|
||||||
doGPSpowersave(false);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
LOG_WARN("No GPS found - running without GPS\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
nodeStatus->observe(&nodeDB.newStatus);
|
nodeStatus->observe(&nodeDB.newStatus);
|
||||||
|
|
||||||
service.init();
|
service.init();
|
||||||
@ -593,17 +582,6 @@ void setup()
|
|||||||
|
|
||||||
screen->print("Started...\n");
|
screen->print("Started...\n");
|
||||||
|
|
||||||
// We have now loaded our saved preferences from flash
|
|
||||||
|
|
||||||
// ONCE we will factory reset the GPS for bug #327
|
|
||||||
if (gps && !devicestate.did_gps_reset) {
|
|
||||||
LOG_WARN("GPS FactoryReset requested\n");
|
|
||||||
if (gps->factoryReset()) { // If we don't succeed try again next time
|
|
||||||
devicestate.did_gps_reset = true;
|
|
||||||
nodeDB.saveToDisk(SEGMENT_DEVICESTATE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef SX126X_ANT_SW
|
#ifdef SX126X_ANT_SW
|
||||||
// make analog PA vs not PA switch on SX126x eval board work properly
|
// make analog PA vs not PA switch on SX126x eval board work properly
|
||||||
pinMode(SX126X_ANT_SW, OUTPUT);
|
pinMode(SX126X_ANT_SW, OUTPUT);
|
||||||
@ -758,6 +736,26 @@ void setup()
|
|||||||
PowerFSM_setup(); // we will transition to ON in a couple of seconds, FIXME, only do this for cold boots, not waking from SDS
|
PowerFSM_setup(); // we will transition to ON in a couple of seconds, FIXME, only do this for cold boots, not waking from SDS
|
||||||
powerFSMthread = new PowerFSMThread();
|
powerFSMthread = new PowerFSMThread();
|
||||||
|
|
||||||
|
gps = createGps();
|
||||||
|
|
||||||
|
if (gps) {
|
||||||
|
gpsStatus->observe(&gps->newStatus);
|
||||||
|
if (config.position.gps_enabled == false && config.position.fixed_position == false) {
|
||||||
|
doGPSpowersave(false);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
LOG_WARN("No GPS found - running without GPS\n");
|
||||||
|
}
|
||||||
|
// We have now loaded our saved preferences from flash
|
||||||
|
|
||||||
|
// ONCE we will factory reset the GPS for bug #327
|
||||||
|
if (gps && !devicestate.did_gps_reset) {
|
||||||
|
LOG_WARN("GPS FactoryReset requested\n");
|
||||||
|
if (gps->factoryReset()) { // If we don't succeed try again next time
|
||||||
|
devicestate.did_gps_reset = true;
|
||||||
|
nodeDB.saveToDisk(SEGMENT_DEVICESTATE);
|
||||||
|
}
|
||||||
|
}
|
||||||
// setBluetoothEnable(false); we now don't start bluetooth until we enter the proper state
|
// setBluetoothEnable(false); we now don't start bluetooth until we enter the proper state
|
||||||
setCPUFast(false); // 80MHz is fine for our slow peripherals
|
setCPUFast(false); // 80MHz is fine for our slow peripherals
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user