From 30be35d6edcc1225325b4d12e9e6b551449066fe Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sat, 16 Oct 2021 13:26:38 +0200 Subject: [PATCH] Fix legacy led support Fix legacy led support (#13368) --- tasmota/support_tasmota.ino | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tasmota/support_tasmota.ino b/tasmota/support_tasmota.ino index f76d8cba3..4ebe63e5c 100644 --- a/tasmota/support_tasmota.ino +++ b/tasmota/support_tasmota.ino @@ -416,11 +416,14 @@ void UpdateLedPowerAll() void SetLedPowerIdx(uint32_t led, uint32_t state) { +/* + // Fix legacy led support 20211016 (Notice: legacy led supports TWO leds max) if (!PinUsed(GPIO_LEDLNK) && (0 == led)) { // Legacy - LED1 is link led only if LED2 is present if (PinUsed(GPIO_LED1, 1)) { led = 1; } } +*/ if (PinUsed(GPIO_LED1, led)) { uint32_t mask = 1 << led; if (state) { @@ -448,10 +451,15 @@ void SetLedPowerIdx(uint32_t led, uint32_t state) #endif // USE_BUZZER } -void SetLedPower(uint32_t state) +void SetLedPower(bool state) { if (!PinUsed(GPIO_LEDLNK)) { // Legacy - Only use LED1 and/or LED2 +/* SetLedPowerIdx(0, state); +*/ + // Fix legacy led support 20211016 (Notice: legacy led supports TWO leds max) + uint32_t led = (PinUsed(GPIO_LED1, 1)) ? 1 : 0; + SetLedPowerIdx(led, state); } else { power_t mask = 1; for (uint32_t i = 0; i < TasmotaGlobal.leds_present; i++) { // Map leds to power