Browse Source

Merge e4297595cf into c86e63d2f5

pull/2662/merge
Kemal 1 day ago
committed by GitHub
parent
commit
fb2985b976
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 12
      src/helpers/NRF52Board.cpp

12
src/helpers/NRF52Board.cpp

@ -143,6 +143,18 @@ void NRF52Board::enterSystemOff(uint8_t reason) {
NRF_POWER->GPREGRET2 = reason;
}
// Turn off the BLE connection LED before deep sleep. Bluefruit's autoConnLed
// (on by default) drives LED_CONN; nRF52 SYSTEMOFF only halts the core and
// leaves GPIO outputs latched in their last state, so the LED would otherwise
// stay lit through hibernation. Stop BLE re-driving the pin, then pull it low.
if (sd_enabled) {
Bluefruit.autoConnLed(false); // stop BLE re-driving the LED
Bluefruit.Advertising.stop(); // stop advertising + its blink timer
}
#if defined(LED_CONN) && (LED_CONN >= 0)
ledOff(LED_CONN); // polarity-aware (respects LED_STATE_ON)
#endif
// Flush serial buffers
Serial.flush();
delay(100);

Loading…
Cancel
Save