@@ -14,9 +14,12 @@ const PowerMgtConfig power_config = {
|
|||||||
|
|
||||||
void R1NeoBoard::initiateShutdown(uint8_t reason) {
|
void R1NeoBoard::initiateShutdown(uint8_t reason) {
|
||||||
// Disable LoRa module power before shutdown
|
// Disable LoRa module power before shutdown
|
||||||
MESH_DEBUG_PRINTLN("R1Neo: shutting down");
|
|
||||||
digitalWrite(SX126X_POWER_EN, LOW);
|
digitalWrite(SX126X_POWER_EN, LOW);
|
||||||
|
|
||||||
|
// Signal IO controller that MCU is off, then release DCDC latch
|
||||||
|
digitalWrite(PIN_SOFT_SHUTDOWN, LOW);
|
||||||
|
digitalWrite(PIN_DCDC_EN_MCU_HOLD, LOW);
|
||||||
|
|
||||||
if (reason == SHUTDOWN_REASON_LOW_VOLTAGE ||
|
if (reason == SHUTDOWN_REASON_LOW_VOLTAGE ||
|
||||||
reason == SHUTDOWN_REASON_BOOT_PROTECT) {
|
reason == SHUTDOWN_REASON_BOOT_PROTECT) {
|
||||||
configureVoltageWake(power_config.lpcomp_ain_channel, power_config.lpcomp_refsel);
|
configureVoltageWake(power_config.lpcomp_ain_channel, power_config.lpcomp_refsel);
|
||||||
|
|||||||
@@ -18,6 +18,12 @@ public:
|
|||||||
R1NeoBoard() : NRF52Board("R1NEO_OTA") {}
|
R1NeoBoard() : NRF52Board("R1NEO_OTA") {}
|
||||||
void begin();
|
void begin();
|
||||||
|
|
||||||
|
#ifdef NRF52_POWER_MANAGEMENT
|
||||||
|
void powerOff() override {
|
||||||
|
initiateShutdown(SHUTDOWN_REASON_USER);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(P_LORA_TX_LED)
|
#if defined(P_LORA_TX_LED)
|
||||||
void onBeforeTransmit() override {
|
void onBeforeTransmit() override {
|
||||||
digitalWrite(P_LORA_TX_LED, HIGH); // turn TX LED on
|
digitalWrite(P_LORA_TX_LED, HIGH); // turn TX LED on
|
||||||
|
|||||||
Reference in New Issue
Block a user