Add saved LED controls across supported boards
Add get leds and set leds on|off for Companion, repeater, room server and sensor builds. Preserve the setting across reboots and cover GPIO, RGB, Bluetooth, notification and expander indicators without changing radio amplifier controls or screen backlights. RAK Companions blink while advertising and keep the Bluetooth LED off once connected, including late timer callbacks. Adapted from meshcore-dev/MeshCore#3605 and #2694. Validated with host regressions and firmware builds for SenseCAP Solar, RAK4631, T096, Heltec V4, T-Beam, Xiao S3, Pico W and Wio E5 Mini. Co-authored-by: R0ck <develop@hectospark.co.uk> Co-authored-by: Nick Dunklee <nick@dunklee.org>
This commit is contained in:
1 parent
c48e679284
commit
9d52b1fd68
91 files changed
+1485
-65
No files matched your search
@@ -6,6 +6,7 @@
|
||||
#include "nrf52/SoftDeviceState.h"
|
||||
#include "nrf52/SleepCycleState.h"
|
||||
#include "nrf52/ShutdownLeds.h"
|
||||
#include "nrf52/BluetoothLed.h"
|
||||
#include <target.h>
|
||||
#include "UserGpioPinPolicy.h"
|
||||
#include "PowerSavingDiagnostics.h"
|
||||
@@ -263,6 +264,10 @@ bool NRF52Board::applyMcuRegulator(mesh::power::RegulatorMode mode) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void NRF52Board::applyLedPolicy() {
|
||||
mesh_nrf52::applyBluetoothLedPolicy();
|
||||
}
|
||||
|
||||
void NRF52Board::loop() {
|
||||
#ifdef NRF52_POWER_MANAGEMENT
|
||||
if (!mesh::power::voltagePolicySupported()) return;
|
||||
@@ -959,10 +964,12 @@ bool NRF52Board::startOTAUpdate(const char *id, char reply[], bool force_ap) {
|
||||
// Even a failed begin can leave SoftDevice enabled partway through SDK
|
||||
// startup. Require a fresh authoritative query before the next sleep.
|
||||
mesh_nrf52::sleepCycleState().invalidate();
|
||||
mesh_nrf52::applyBluetoothLedPolicy();
|
||||
if (!Bluefruit.begin(1, 0)) {
|
||||
return false;
|
||||
}
|
||||
ota_ble_started = true;
|
||||
mesh_nrf52::bluetoothLedStarted();
|
||||
|
||||
// To be consistent OTA DFU should be added first if it exists
|
||||
bledfu.begin();
|
||||
|
||||
Reference in new issue
Block a user