Skip to content

Commit 6b4592b

Browse files
committed
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
1 parent 73b1ac5 commit 6b4592b

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

src/helpers/sensors/EnvironmentSensorManager.cpp

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,10 @@ static Adafruit_INA3221 INA3221;
4747
static Adafruit_INA219 INA219(TELEM_INA219_ADDRESS);
4848
#endif
4949

50-
#if ENV_INCLUDE_GPS & RAK_BOARD
51-
uint32_t gpsResetPin = 0;
52-
bool i2cGPSFlag = false;
53-
bool serialGPSFlag = false;
54-
//#define PIN_GPS_STANDBY_A 34 //GPS Reset/Standby pin (IO2 for socket A)
55-
//#define PIN_GPS_STANDBY_C 4 //GPS Reset/Standby pin (IO4 for socket C)
56-
//#define PIN_GPS_STANDBY_F 9 //GPS Reset/Standby pin (IO5 for socket F)
50+
#if ENV_INCLUDE_GPS && RAK_BOARD
51+
static uint32_t gpsResetPin = 0;
52+
static bool i2cGPSFlag = false;
53+
static bool serialGPSFlag = false;
5754
#define TELEM_RAK12500_ADDRESS 0x42 //RAK12500 Ublox GPS via i2c
5855
#include <SparkFun_u-blox_GNSS_Arduino_Library.h>
5956
static SFE_UBLOX_GNSS ublox_GNSS;
@@ -323,8 +320,6 @@ void EnvironmentSensorManager::rakGPSInit(){
323320
Serial1.begin(9600);
324321
#endif
325322

326-
delay(1000);
327-
328323
//search for the correct IO standby pin depending on socket used
329324
if(gpsIsAwake(WB_IO2)){
330325
// MESH_DEBUG_PRINTLN("RAK base board is RAK19007/10");
@@ -356,9 +351,9 @@ bool EnvironmentSensorManager::gpsIsAwake(uint8_t ioPin){
356351
//set initial waking state
357352
pinMode(ioPin,OUTPUT);
358353
digitalWrite(ioPin,LOW);
359-
delay(1000);
354+
delay(500);
360355
digitalWrite(ioPin,HIGH);
361-
delay(1000);
356+
delay(500);
362357

363358
//Try to init RAK12500 on I2C
364359
if (ublox_GNSS.begin(Wire) == true){

variants/rak4631/platformio.ini

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ board = wiscore_rak4631
55
board_check = true
66
build_flags = ${nrf52_base.build_flags}
77
-I variants/rak4631
8+
-D RAK_4631
89
-D RAK_BOARD
910
-D PIN_BOARD_SCL=14
1011
-D PIN_BOARD_SDA=13
@@ -18,14 +19,20 @@ build_flags = ${nrf52_base.build_flags}
1819
-D SX126X_CURRENT_LIMIT=140
1920
-D SX126X_RX_BOOSTED_GAIN=1
2021
-D ENV_INCLUDE_GPS=1
22+
-D ENV_INCLUDE_SHTC3=1
23+
-D ENV_INCLUDE_LPS22HB=1
24+
-D ENV_INCLUDE_INA219=1
2125
build_src_filter = ${nrf52_base.build_src_filter}
2226
+<../variants/rak4631>
2327
+<helpers/sensors>
2428
lib_deps =
2529
${nrf52_base.lib_deps}
2630
adafruit/Adafruit SSD1306 @ ^2.5.13
2731
stevemarple/MicroNMEA @ ^2.0.6
28-
sparkfun/SparkFun u-blox GNSS Arduino Library @ ^2.2.27
32+
adafruit/Adafruit SHTC3 Library@^1.0.1
33+
arduino-libraries/Arduino_LPS22HB@^1.0.2
34+
adafruit/Adafruit INA219@^1.2.3
35+
sparkfun/SparkFun u-blox GNSS Arduino Library@^2.2.27
2936

3037
[env:RAK_4631_Repeater]
3138
extends = rak4631

0 commit comments

Comments
 (0)