From f5ce12a6413d7c950af5488be8ab540f6875adf2 Mon Sep 17 00:00:00 2001 From: Florian <1technophile@users.noreply.github.com> Date: Wed, 16 Nov 2022 14:15:00 -0600 Subject: [PATCH] Add rgb gpio powering pin (#1321) * Add RGB GPIO powering pin When the RGB Led is powered by an uC pin, enable to power it up from the led setup * Comments improvements --- main/User_config.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main/User_config.h b/main/User_config.h index d5142b1..e038800 100644 --- a/main/User_config.h +++ b/main/User_config.h @@ -388,6 +388,7 @@ int lowpowermode = DEFAULT_LOW_POWER_MODE; # define ota_timeout_millis 30000 #endif +/*-------------ERRORS, INFOS, SEND RECEIVE Display through LED----------------*/ #ifndef RGB_INDICATORS // Management of Errors, reception/emission and informations indicators with basic LED /*-------------DEFINE PINs FOR STATUS LEDs----------------*/ # ifndef LED_SEND_RECEIVE @@ -449,9 +450,14 @@ int lowpowermode = DEFAULT_LOW_POWER_MODE; #else // Management of Errors, reception/emission and informations indicators with RGB LED # include CRGB leds[FASTLED_IND_NUM_LEDS]; +# ifndef RGB_LED_POWER +# define RGB_LED_POWER -1 // If the RGB Led is linked to GPIO pin for power define it here +# endif # define SetupIndicators() \ + pinMode(RGB_LED_POWER, OUTPUT); \ + digitalWrite(RGB_LED_POWER, HIGH); \ FastLED.addLeds(leds, FASTLED_IND_NUM_LEDS); \ - FastLED.setBrightness(20); /* Error, warning and infos display management*/ + FastLED.setBrightness(20); # define ErrorIndicatorON() \ leds[0] = CRGB::Red; \ FastLED.show()