mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
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 <frieder@fris.de>
This commit is contained in:
parent
e79ee11872
commit
ab7935142c
1 changed files with 3 additions and 0 deletions
|
|
@ -615,6 +615,7 @@ void EnvironmentSensorManager::rakGPSInit(){
|
||||||
MESH_DEBUG_PRINTLN("No GPS found");
|
MESH_DEBUG_PRINTLN("No GPS found");
|
||||||
gps_active = false;
|
gps_active = false;
|
||||||
gps_detected = false;
|
gps_detected = false;
|
||||||
|
Serial1.end();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -663,6 +664,8 @@ bool EnvironmentSensorManager::gpsIsAwake(uint8_t ioPin){
|
||||||
gps_detected = true;
|
gps_detected = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pinMode(ioPin, INPUT);
|
||||||
MESH_DEBUG_PRINTLN("GPS did not init with this IO pin... try the next");
|
MESH_DEBUG_PRINTLN("GPS did not init with this IO pin... try the next");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue