Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion variants/sensecap_solar/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ build_flags = ${nrf52_base.build_flags}
-I lib/nrf52/s140_nrf52_7.3.0_API/include/nrf52
-I variants/sensecap_solar
-I src/helpers/nrf52
-UENV_INCLUDE_GPS
-D ENV_INCLUDE_GPS=1
-D NRF52_PLATFORM=1
-D RADIO_CLASS=CustomSX1262
-D WRAPPER_CLASS=CustomSX1262Wrapper
Expand All @@ -24,6 +24,12 @@ build_flags = ${nrf52_base.build_flags}
-D SX126X_DIO3_TCXO_VOLTAGE=1.8
-D SX126X_CURRENT_LIMIT=140
-D SX126X_RX_BOOSTED_GAIN=1
-D PIN_GPS_TX=7
-D PIN_GPS_RX=6
-D PIN_GPS_EN=18
-D PIN_GPS_STANDBY=0
-D PIN_GPS_EN_ACTIVE=HIGH
-D GPS_BAUD_RATE=9600
build_src_filter = ${nrf52_base.build_src_filter}
+<helpers/*.cpp>
+<helpers/sensors>
Expand All @@ -33,6 +39,7 @@ upload_protocol = nrfutil
lib_deps =
${nrf52_base.lib_deps}
${sensor_base.lib_deps}
stevemarple/MicroNMEA @ ^2.0.6

[env:SenseCap_Solar_repeater]
extends = SenseCap_Solar
Expand Down
12 changes: 11 additions & 1 deletion variants/sensecap_solar/target.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
#include "target.h"
#include <helpers/ArduinoHelpers.h>

#ifdef ENV_INCLUDE_GPS
#include <helpers/sensors/MicroNMEALocationProvider.h>
#endif

SenseCapSolarBoard board;

RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, SPI);
Expand All @@ -10,7 +14,13 @@ WRAPPER_CLASS radio_driver(radio, board);

VolatileRTCClock fallback_clock;
AutoDiscoverRTCClock rtc_clock(fallback_clock);
EnvironmentSensorManager sensors;

#ifdef ENV_INCLUDE_GPS
MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1, &rtc_clock, PIN_GPS_STANDBY, PIN_GPS_EN);
EnvironmentSensorManager sensors = EnvironmentSensorManager(nmea);
#else
EnvironmentSensorManager sensors = EnvironmentSensorManager();
#endif

bool radio_init() {
rtc_clock.begin(Wire);
Expand Down
4 changes: 4 additions & 0 deletions variants/sensecap_solar/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
#include <helpers/ArduinoHelpers.h>
#include <helpers/sensors/EnvironmentSensorManager.h>

#ifdef ENV_INCLUDE_GPS
#include <helpers/sensors/MicroNMEALocationProvider.h>
#endif

extern SenseCapSolarBoard board;
extern WRAPPER_CLASS radio_driver;
extern AutoDiscoverRTCClock rtc_clock;
Expand Down
12 changes: 5 additions & 7 deletions variants/sensecap_solar/variant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ const uint32_t g_ADigitalPinMap[] = {
};

void initVariant() {
pinMode(GPS_EN, OUTPUT);
digitalWrite(GPS_EN, LOW);

pinMode(BATTERY_PIN, INPUT);
pinMode(VBAT_ENABLE, OUTPUT);
digitalWrite(VBAT_ENABLE, LOW);
Expand All @@ -64,8 +61,9 @@ void initVariant() {
pinMode(LED_BLUE, OUTPUT);
digitalWrite(LED_BLUE, LOW);

/* disable gps until we actually support it.
pinMode(GPS_EN, OUTPUT);
digitalWrite(GPS_EN, HIGH);
*/
#ifdef ENV_INCLUDE_GPS
// Initialize GPS enable pin (GPS will be powered on/off by sensor manager)
pinMode(PIN_GPS_EN, OUTPUT);
digitalWrite(PIN_GPS_EN, LOW); // Start with GPS off
#endif
}
3 changes: 2 additions & 1 deletion variants/sensecap_solar/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@
#define PIN_GPS_TX PIN_SERIAL1_RX
#define PIN_GPS_RX PIN_SERIAL1_TX
#define PIN_GPS_STANDBY (0)
#define GPS_EN (18)
#define PIN_GPS_EN (18)
#define GPS_EN PIN_GPS_EN // Alias for compatibility

// QSPI Pins
#define PIN_QSPI_SCK (21)
Expand Down