Adding multiple compile time pins.
This commit is contained in:
parent
f91384596c
commit
caae57d960
@ -53,11 +53,26 @@ void WS2812FX::finalizeInit(void)
|
||||
RESET_RUNTIME;
|
||||
_useRgbw = false;
|
||||
|
||||
//if busses failed to load, add default (FS issue...)
|
||||
//if busses failed to load, add default (fresh install, FS issue, ...)
|
||||
if (busses.getNumBusses() == 0) {
|
||||
uint8_t defPin[] = {LEDPIN};
|
||||
BusConfig defCfg = BusConfig(TYPE_WS2812_RGB, defPin, 0, 30, COL_ORDER_GRB, false, false);
|
||||
busses.add(defCfg);
|
||||
#ifdef LEDPIN1
|
||||
defPin[0] = {LEDPIN1};
|
||||
defCfg = BusConfig(TYPE_WS2812_RGB, defPin, 0, 30, COL_ORDER_GRB, false, false);
|
||||
busses.add(defCfg);
|
||||
#endif
|
||||
#ifdef LEDPIN2
|
||||
defPin[0] = {LEDPIN2};
|
||||
defCfg = BusConfig(TYPE_WS2812_RGB, defPin, 0, 30, COL_ORDER_GRB, false, false);
|
||||
busses.add(defCfg);
|
||||
#endif
|
||||
#ifdef LEDPIN3
|
||||
defPin[0] = {LEDPIN3};
|
||||
defCfg = BusConfig(TYPE_WS2812_RGB, defPin, 0, 30, COL_ORDER_GRB, false, false);
|
||||
busses.add(defCfg);
|
||||
#endif
|
||||
}
|
||||
|
||||
deserializeMap();
|
||||
|
@ -242,7 +242,11 @@
|
||||
|
||||
//this is merely a default now and can be changed at runtime
|
||||
#ifndef LEDPIN
|
||||
#define LEDPIN 2
|
||||
#ifdef ESP8266
|
||||
#define LEDPIN 2 // GPIO2 (D4) on Wemod D1 mini compatible boards
|
||||
#else
|
||||
#define LEDPIN 16 // alligns with GPIO2 (D4) on Wemos D1 mini32 compatible boards
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -423,8 +423,8 @@ void serializeInfo(JsonObject root)
|
||||
leds[F("count")] = ledCount;
|
||||
leds[F("rgbw")] = useRGBW;
|
||||
leds[F("wv")] = useRGBW && (strip.rgbwMode == RGBW_MODE_MANUAL_ONLY || strip.rgbwMode == RGBW_MODE_DUAL); //should a white channel slider be displayed?
|
||||
|
||||
JsonArray leds_pin = leds.createNestedArray("pin");
|
||||
//leds_pin.add(LEDPIN);
|
||||
for (uint8_t s=0; s<busses.getNumBusses(); s++) {
|
||||
Bus *bus = busses.getBus(s);
|
||||
uint8_t pins[5];
|
||||
|
Loading…
Reference in New Issue
Block a user