Repeater, room server, sensor, companion: disconnect GPS UART pins when GPS is powered off on nRF52
This commit is contained in:
1 parent
c454dcba54
commit
6a5ec9debc
2 files changed
+10
-1
No files matched your search
@@ -204,7 +204,13 @@ class NmeaGpsDriver : public GpsDriver {
|
||||
// core's own Uart::end()) for all the hours `gps duty` keeps the GPS off, and
|
||||
// its idle-high TX line feeds the unpowered module. sendNmeaSentence() is
|
||||
// gated on _started: a write to a closed Uart takes a deleted semaphore.
|
||||
if (_hardwareSerial != nullptr) _hardwareSerial->end();
|
||||
// Uart::end() clears PSEL but leaves GPIO PIN_CNF unchanged, so disconnect
|
||||
// the pins explicitly to avoid back-powering the unpowered GPS module.
|
||||
if (_hardwareSerial != nullptr) {
|
||||
_hardwareSerial->end();
|
||||
if (_txPin != -1) nrf_gpio_cfg_default(g_ADigitalPinMap[_txPin]);
|
||||
if (_rxPin != -1) nrf_gpio_cfg_default(g_ADigitalPinMap[_rxPin]);
|
||||
}
|
||||
#endif
|
||||
_started = false;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user