From fe72d0321a30397e390c6c21cb6a79ce11de54de Mon Sep 17 00:00:00 2001 From: Bill Plein <260078+bplein@users.noreply.github.com> Date: Fri, 7 Aug 2026 17:51:01 -0500 Subject: [PATCH] Allow for build-time macro to disable the bluetooth LED Several variants use one or another method to disable the bluetooth LED that is grabbed by the Adafruit Bluefruit library by default. This allows for single build_flags macro to control the behavior (default behavior if not defined, not auto-controlled by Bluefruit if defined). This would open up for future cases where this could be controlled via a CLI command or by an application. Does not change behavior if the flag is not defined. --- src/helpers/nrf52/SerialBLEInterface.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/helpers/nrf52/SerialBLEInterface.cpp b/src/helpers/nrf52/SerialBLEInterface.cpp index 75a4e3b064..2e5626a8de 100644 --- a/src/helpers/nrf52/SerialBLEInterface.cpp +++ b/src/helpers/nrf52/SerialBLEInterface.cpp @@ -129,6 +129,12 @@ void SerialBLEInterface::begin(const char* prefix, char* name, uint32_t pin_code char charpin[20]; snprintf(charpin, sizeof(charpin), "%lu", (unsigned long)pin_code); + #ifdef DISABLE_BLE_LED \\ use variant platformio.ini build_flags macro: -D DISABLE_BLE_LED + Bluefruit.autoConnLed(false); \\ false removes the automatic control of the LED by the Bluefruit library + #else + Bluefruit.autoConnLed(true); \\ true leaves the default automatic control of the LED by the Bluefruit library + #endif + // If we want to control BLE LED ourselves, uncomment this: // Bluefruit.autoConnLed(false); Bluefruit.configPrphBandwidth(BANDWIDTH_MAX);