diff --git a/variants/heltec_t114/T114Board.h b/variants/heltec_t114/T114Board.h index f27dc291d0..49f5a06dbf 100644 --- a/variants/heltec_t114/T114Board.h +++ b/variants/heltec_t114/T114Board.h @@ -50,10 +50,14 @@ class T114Board : public NRF52BoardDCDC { #ifdef LED_PIN digitalWrite(LED_PIN, HIGH); #endif +#ifdef NRF52_POWER_MANAGEMENT + initiateShutdown(SHUTDOWN_REASON_USER); +#else #if ENV_INCLUDE_GPS == 1 pinMode(GPS_EN, OUTPUT); digitalWrite(GPS_EN, LOW); #endif sd_power_system_off(); +#endif } }; diff --git a/variants/rak4631/RAK4631Board.cpp b/variants/rak4631/RAK4631Board.cpp index 9fb47b432e..1aa5098f27 100644 --- a/variants/rak4631/RAK4631Board.cpp +++ b/variants/rak4631/RAK4631Board.cpp @@ -15,6 +15,9 @@ const PowerMgtConfig power_config = { void RAK4631Board::initiateShutdown(uint8_t reason) { // Disable LoRa module power before shutdown digitalWrite(SX126X_POWER_EN, LOW); + // RAK4631 has no buttons; clear DIO1 SENSE (set by RadioLib) so the + // floating pin doesn't trigger an immediate wakeup from SYSTEMOFF. + nrf_gpio_cfg_default(P_LORA_DIO_1); if (reason == SHUTDOWN_REASON_LOW_VOLTAGE || reason == SHUTDOWN_REASON_BOOT_PROTECT) { diff --git a/variants/rak4631/RAK4631Board.h b/variants/rak4631/RAK4631Board.h index 7e67165b19..44dd32a03b 100644 --- a/variants/rak4631/RAK4631Board.h +++ b/variants/rak4631/RAK4631Board.h @@ -35,4 +35,10 @@ class RAK4631Board : public NRF52BoardDCDC { const char* getManufacturerName() const override { return "RAK 4631"; } + +#ifdef NRF52_POWER_MANAGEMENT + void powerOff() override { + initiateShutdown(SHUTDOWN_REASON_USER); + } +#endif };