Browse Source

EnvironmentSensorManager.cpp: Cleanup after failed RAK4631 GPS detection

If no GPS was detected, revert the hardware to the initial state,
otherwise we may see conflicts or increased power consumption on some
boards.

Signed-off-by: Frieder Schrempf <[email protected]>
pull/1300/head
Frieder Schrempf 6 months ago
parent
commit
ab7935142c
No known key found for this signature in database GPG Key ID: E7DD51F45F833802
  1. 3
      src/helpers/sensors/EnvironmentSensorManager.cpp

3
src/helpers/sensors/EnvironmentSensorManager.cpp

@ -615,6 +615,7 @@ void EnvironmentSensorManager::rakGPSInit(){
MESH_DEBUG_PRINTLN("No GPS found");
gps_active = false;
gps_detected = false;
Serial1.end();
return;
}
@ -663,6 +664,8 @@ bool EnvironmentSensorManager::gpsIsAwake(uint8_t ioPin){
gps_detected = true;
return true;
}
pinMode(ioPin, INPUT);
MESH_DEBUG_PRINTLN("GPS did not init with this IO pin... try the next");
return false;
}

Loading…
Cancel
Save