Use BLE_LED where present for CONNECTED/DISCONNECTED

This commit is contained in:
Andreas 'count' Kotes 2025-04-21 11:01:28 +02:00 committed by Thomas Göttgens
parent 070deb290f
commit da44d23699
3 changed files with 17 additions and 1 deletions

View File

@ -88,10 +88,16 @@ class BluetoothStatus : public Status
break;
case ConnectionState::CONNECTED:
LOG_DEBUG("BluetoothStatus CONNECTED");
#ifdef BLE_LED
digitalWrite(BLE_LED, HIGH);
#endif
break;
case ConnectionState::DISCONNECTED:
LOG_DEBUG("BluetoothStatus DISCONNECTED");
#ifdef BLE_LED
digitalWrite(BLE_LED, LOW);
#endif
break;
}
}

View File

@ -345,6 +345,11 @@ void setup()
digitalWrite(USER_LED, LOW);
#endif
#ifdef BLE_LED
pinMode(BLE_LED, OUTPUT);
digitalWrite(BLE_LED, LOW);
#endif
#if defined(T_DECK)
// GPIO10 manages all peripheral power supplies
// Turn on peripheral power immediately after MUC starts.

View File

@ -171,6 +171,11 @@ void NimbleBluetooth::deinit()
{
#ifdef ARCH_ESP32
LOG_INFO("Disable bluetooth until reboot");
#ifdef BLE_LED
digitalWrite(BLE_LED, LOW);
#endif
NimBLEDevice::deinit();
#endif
}