mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-29 11:01:15 +00:00
Fix crash in GPS setup when GPS is disabled
This commit is contained in:
parent
899f9dd7bf
commit
0fa3685161
@ -661,6 +661,8 @@ bool GPS::setupGPS()
|
|||||||
if (getACK(0x06, 0x86, 300) != GNSS_RESPONSE_OK) {
|
if (getACK(0x06, 0x86, 300) != GNSS_RESPONSE_OK) {
|
||||||
LOG_WARN("Unable to enable powersaving for GPS.\n");
|
LOG_WARN("Unable to enable powersaving for GPS.\n");
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// use cfg-rxm
|
||||||
}
|
}
|
||||||
// We need save configuration to flash to make our config changes persistent
|
// We need save configuration to flash to make our config changes persistent
|
||||||
uint8_t _message_SAVE[21] = {
|
uint8_t _message_SAVE[21] = {
|
||||||
@ -721,7 +723,6 @@ bool GPS::setup()
|
|||||||
|
|
||||||
if (config.position.gps_enabled == false && config.position.fixed_position == false) {
|
if (config.position.gps_enabled == false && config.position.fixed_position == false) {
|
||||||
setAwake(false);
|
setAwake(false);
|
||||||
doGPSpowersave(false);
|
|
||||||
}
|
}
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
@ -562,6 +562,9 @@ void setup()
|
|||||||
|
|
||||||
if (gps) {
|
if (gps) {
|
||||||
gpsStatus->observe(&gps->newStatus);
|
gpsStatus->observe(&gps->newStatus);
|
||||||
|
if (config.position.gps_enabled == false && config.position.fixed_position == false) {
|
||||||
|
doGPSpowersave(false);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
LOG_WARN("No GPS found - running without GPS\n");
|
LOG_WARN("No GPS found - running without GPS\n");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user