Merge pull request #3275 from liamcottle/gps/rak3401
Fix PA on RAK3401 when GPS missing
This commit is contained in:
1 file changed
+10
@@ -831,11 +831,15 @@ bool EnvironmentSensorManager::gpsIsAwake(uint8_t ioPin){
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef RAK_3401
|
||||||
//set initial waking state
|
//set initial waking state
|
||||||
pinMode(ioPin,OUTPUT);
|
pinMode(ioPin,OUTPUT);
|
||||||
digitalWrite(ioPin,LOW);
|
digitalWrite(ioPin,LOW);
|
||||||
delay(500);
|
delay(500);
|
||||||
digitalWrite(ioPin,HIGH);
|
digitalWrite(ioPin,HIGH);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// give gps time to power up
|
||||||
delay(500);
|
delay(500);
|
||||||
|
|
||||||
//Try to init RAK12500 on I2C
|
//Try to init RAK12500 on I2C
|
||||||
@@ -871,7 +875,9 @@ bool EnvironmentSensorManager::gpsIsAwake(uint8_t ioPin){
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef RAK_3401
|
||||||
pinMode(ioPin, INPUT);
|
pinMode(ioPin, INPUT);
|
||||||
|
#endif
|
||||||
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;
|
||||||
}
|
}
|
||||||
@@ -880,8 +886,10 @@ bool EnvironmentSensorManager::gpsIsAwake(uint8_t ioPin){
|
|||||||
void EnvironmentSensorManager::start_gps() {
|
void EnvironmentSensorManager::start_gps() {
|
||||||
gps_active = true;
|
gps_active = true;
|
||||||
#ifdef RAK_WISBLOCK_GPS
|
#ifdef RAK_WISBLOCK_GPS
|
||||||
|
#ifndef RAK_3401
|
||||||
pinMode(gpsResetPin, OUTPUT);
|
pinMode(gpsResetPin, OUTPUT);
|
||||||
digitalWrite(gpsResetPin, HIGH);
|
digitalWrite(gpsResetPin, HIGH);
|
||||||
|
#endif
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -896,8 +904,10 @@ void EnvironmentSensorManager::start_gps() {
|
|||||||
void EnvironmentSensorManager::stop_gps() {
|
void EnvironmentSensorManager::stop_gps() {
|
||||||
gps_active = false;
|
gps_active = false;
|
||||||
#ifdef RAK_WISBLOCK_GPS
|
#ifdef RAK_WISBLOCK_GPS
|
||||||
|
#ifndef RAK_3401 // rak3401 shouldn't turn off WB_IO2 as it powers the PA
|
||||||
pinMode(gpsResetPin, OUTPUT);
|
pinMode(gpsResetPin, OUTPUT);
|
||||||
digitalWrite(gpsResetPin, LOW);
|
digitalWrite(gpsResetPin, LOW);
|
||||||
|
#endif
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user