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){

View File

@@ -5,6 +5,7 @@ board = wiscore_rak4631
board_check = true
build_flags = ${nrf52_base.build_flags}
-I variants/rak4631
-D RAK_4631
-D RAK_BOARD
-D PIN_BOARD_SCL=14
-D PIN_BOARD_SDA=13
@@ -18,6 +19,9 @@ build_flags = ${nrf52_base.build_flags}
-D SX126X_CURRENT_LIMIT=140
-D SX126X_RX_BOOSTED_GAIN=1
-D ENV_INCLUDE_GPS=1
-D ENV_INCLUDE_SHTC3=1
-D ENV_INCLUDE_LPS22HB=1
-D ENV_INCLUDE_INA219=1
build_src_filter = ${nrf52_base.build_src_filter}
+<../variants/rak4631>
+<helpers/sensors>
@@ -25,7 +29,10 @@ lib_deps =
${nrf52_base.lib_deps}
adafruit/Adafruit SSD1306 @ ^2.5.13
stevemarple/MicroNMEA @ ^2.0.6
sparkfun/SparkFun u-blox GNSS Arduino Library @ ^2.2.27
adafruit/Adafruit SHTC3 Library@^1.0.1
arduino-libraries/Arduino_LPS22HB@^1.0.2
adafruit/Adafruit INA219@^1.2.3
sparkfun/SparkFun u-blox GNSS Arduino Library@^2.2.27
[env:RAK_4631_Repeater]
extends = rak4631