Cleanup and fixes

-Added RAK_4631 define back
-Added includes for common RAK sensors that are currently supported in ESM
-Set global variables to static
-Reduced delay time within the RAK gps init sequence
This commit is contained in:
cod3doomy 2025-07-17 10:42:18 -07:00
parent 73b1ac5190
commit 6b4592bfe2
2 changed files with 14 additions and 12 deletions

View file

@ -47,13 +47,10 @@ static Adafruit_INA3221 INA3221;
static Adafruit_INA219 INA219(TELEM_INA219_ADDRESS);
#endif
#if ENV_INCLUDE_GPS & RAK_BOARD
uint32_t gpsResetPin = 0;
bool i2cGPSFlag = false;
bool serialGPSFlag = false;
//#define PIN_GPS_STANDBY_A 34 //GPS Reset/Standby pin (IO2 for socket A)
//#define PIN_GPS_STANDBY_C 4 //GPS Reset/Standby pin (IO4 for socket C)
//#define PIN_GPS_STANDBY_F 9 //GPS Reset/Standby pin (IO5 for socket F)
#if ENV_INCLUDE_GPS && RAK_BOARD
static uint32_t gpsResetPin = 0;
static bool i2cGPSFlag = false;
static bool serialGPSFlag = false;
#define TELEM_RAK12500_ADDRESS 0x42 //RAK12500 Ublox GPS via i2c
#include <SparkFun_u-blox_GNSS_Arduino_Library.h>
static SFE_UBLOX_GNSS ublox_GNSS;
@ -323,8 +320,6 @@ void EnvironmentSensorManager::rakGPSInit(){
Serial1.begin(9600);
#endif
delay(1000);
//search for the correct IO standby pin depending on socket used
if(gpsIsAwake(WB_IO2)){
// MESH_DEBUG_PRINTLN("RAK base board is RAK19007/10");
@ -356,9 +351,9 @@ bool EnvironmentSensorManager::gpsIsAwake(uint8_t ioPin){
//set initial waking state
pinMode(ioPin,OUTPUT);
digitalWrite(ioPin,LOW);
delay(1000);
delay(500);
digitalWrite(ioPin,HIGH);
delay(1000);
delay(500);
//Try to init RAK12500 on I2C
if (ublox_GNSS.begin(Wire) == true){