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
This commit is contained in:
Florian authored and GitHub committed 2022-11-16 14:15:00 -06:00
1 parent 33e162111a
commit f5ce12a641
1 file changed
+7 -1
+7 -1
View File
@@ -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 <FastLED.h>
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<FASTLED_IND_TYPE, FASTLED_IND_DATA_GPIO>(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()