diff --git a/src/modules/DetectionSensorModule.cpp b/src/modules/DetectionSensorModule.cpp index f1fc26244..6c35e94ae 100644 --- a/src/modules/DetectionSensorModule.cpp +++ b/src/modules/DetectionSensorModule.cpp @@ -28,6 +28,12 @@ int32_t DetectionSensorModule::runOnce() return disable(); if (firstTime) { + +#ifdef DETECTION_SENSOR_EN + pinMode(DETECTION_SENSOR_EN, OUTPUT); + digitalWrite(DETECTION_SENSOR_EN, HIGH); +#endif + // This is the first time the OSThread library has called this function, so do some setup firstTime = false; if (moduleConfig.detection_sensor.monitor_pin > 0) { diff --git a/variants/rak11310/variant.h b/variants/rak11310/variant.h index c2ab3628d..1ea6d141d 100644 --- a/variants/rak11310/variant.h +++ b/variants/rak11310/variant.h @@ -22,6 +22,8 @@ // ratio of voltage divider = 3.0 (R17=200k, R18=100k) #define ADC_MULTIPLIER 3.1 // 3.0 + a bit for being optimistic +#define DETECTION_SENSOR_EN 28 + #define USE_SX1262 #undef RF95_SCK @@ -51,4 +53,4 @@ // DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3 #define SX126X_DIO2_AS_RF_SWITCH #define SX126X_DIO3_TCXO_VOLTAGE 1.8 -#endif +#endif \ No newline at end of file diff --git a/variants/rak4631/variant.h b/variants/rak4631/variant.h index 7b5f6b14d..89bb62c73 100644 --- a/variants/rak4631/variant.h +++ b/variants/rak4631/variant.h @@ -201,6 +201,8 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG */ +#define DETECTION_SENSOR_EN 4 + #define USE_SX1262 #define SX126X_CS (42) #define SX126X_DIO1 (47) @@ -223,7 +225,7 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG // Therefore must be 1 to keep peripherals powered // Power is on the controllable 3V3_S rail // #define PIN_GPS_RESET (34) -#define PIN_GPS_EN PIN_3V3_EN +// #define PIN_GPS_EN PIN_3V3_EN #define PIN_GPS_PPS (17) // Pulse per second input from the GPS #define GPS_RX_PIN PIN_SERIAL1_RX @@ -277,4 +279,4 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG * Arduino objects - C++ only *----------------------------------------------------------------------------*/ -#endif +#endif \ No newline at end of file