Skip to content

Commit cc6139b

Browse files
authored
Merge pull request #2371 from weebl2000/r1-neo-shutdown
Implement proper shutdown procedure for R1 neo
2 parents d532481 + 07671cf commit cc6139b

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

variants/muziworks_r1_neo/R1NeoBoard.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ const PowerMgtConfig power_config = {
1414

1515
void R1NeoBoard::initiateShutdown(uint8_t reason) {
1616
// Disable LoRa module power before shutdown
17-
MESH_DEBUG_PRINTLN("R1Neo: shutting down");
1817
digitalWrite(SX126X_POWER_EN, LOW);
1918

19+
// Signal IO controller that MCU is off, then release DCDC latch
20+
digitalWrite(PIN_SOFT_SHUTDOWN, LOW);
21+
digitalWrite(PIN_DCDC_EN_MCU_HOLD, LOW);
22+
2023
if (reason == SHUTDOWN_REASON_LOW_VOLTAGE ||
2124
reason == SHUTDOWN_REASON_BOOT_PROTECT) {
2225
configureVoltageWake(power_config.lpcomp_ain_channel, power_config.lpcomp_refsel);

variants/muziworks_r1_neo/R1NeoBoard.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ class R1NeoBoard : public NRF52BoardDCDC {
1818
R1NeoBoard() : NRF52Board("R1NEO_OTA") {}
1919
void begin();
2020

21+
#ifdef NRF52_POWER_MANAGEMENT
22+
void powerOff() override {
23+
initiateShutdown(SHUTDOWN_REASON_USER);
24+
}
25+
#endif
26+
2127
#if defined(P_LORA_TX_LED)
2228
void onBeforeTransmit() override {
2329
digitalWrite(P_LORA_TX_LED, HIGH); // turn TX LED on

0 commit comments

Comments
 (0)