mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-30 03:13:51 +00:00
fix crash during shutdown (#2859)
* fix null pointer access * ptr initialize
This commit is contained in:
parent
94c2ade272
commit
f301e236eb
@ -20,7 +20,7 @@ HardwareSerial *GPS::_serial_gps = &Serial1;
|
|||||||
HardwareSerial *GPS::_serial_gps = NULL;
|
HardwareSerial *GPS::_serial_gps = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
GPS *gps;
|
GPS *gps = nullptr;
|
||||||
|
|
||||||
/// Multiple GPS instances might use the same serial port (in sequence), but we can
|
/// Multiple GPS instances might use the same serial port (in sequence), but we can
|
||||||
/// only init that port once.
|
/// only init that port once.
|
||||||
|
@ -193,7 +193,8 @@ void doDeepSleep(uint32_t msecToWake, bool skipPreflight = false)
|
|||||||
nodeDB.saveToDisk();
|
nodeDB.saveToDisk();
|
||||||
|
|
||||||
// Kill GPS power completely (even if previously we just had it in sleep mode)
|
// Kill GPS power completely (even if previously we just had it in sleep mode)
|
||||||
gps->setGPSPower(false, false, 0);
|
if (gps)
|
||||||
|
gps->setGPSPower(false, false, 0);
|
||||||
|
|
||||||
setLed(false);
|
setLed(false);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user