Always copy all the pin data
This commit is contained in:
@@ -56,7 +56,7 @@ class RgbRotaryEncoderUsermod : public Usermod
|
||||
|
||||
void initLedBus()
|
||||
{
|
||||
byte _pins[5] = {(byte)ledIo, 255, 255, 255, 255};
|
||||
byte _pins[OUTPUT_MAX_PINS] = {(byte)ledIo, 255, 255, 255, 255};
|
||||
BusConfig busCfg = BusConfig(TYPE_WS2812_RGB, _pins, 0, numLeds, COL_ORDER_GRB, false, 0);
|
||||
|
||||
ledBus = new BusDigital(busCfg, WLED_MAX_BUSSES - 1);
|
||||
|
||||
@@ -391,7 +391,7 @@ struct BusConfig {
|
||||
{
|
||||
refreshReq = (bool) GET_BIT(busType,7);
|
||||
type = busType & 0x7F; // bit 7 may be/is hacked to include refresh info (1=refresh in off state, 0=no refresh)
|
||||
size_t nPins = Bus::getNumberOfPins(type);
|
||||
size_t nPins = OUTPUT_MAX_PINS;
|
||||
for (size_t i = 0; i < nPins; i++) pins[i] = ppins[i];
|
||||
}
|
||||
|
||||
|
||||
@@ -193,7 +193,7 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
|
||||
|
||||
for (JsonObject elm : ins) {
|
||||
if (s >= WLED_MAX_BUSSES+WLED_MIN_VIRTUAL_BUSSES) break;
|
||||
uint8_t pins[5] = {255, 255, 255, 255, 255};
|
||||
uint8_t pins[OUTPUT_MAX_PINS] = {255, 255, 255, 255, 255};
|
||||
JsonArray pinArr = elm["pin"];
|
||||
if (pinArr.size() == 0) continue;
|
||||
//pins[0] = pinArr[0];
|
||||
|
||||
@@ -125,7 +125,7 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
|
||||
|
||||
unsigned colorOrder, type, skip, awmode, channelSwap, maPerLed;
|
||||
unsigned length, start, maMax;
|
||||
uint8_t pins[5] = {255, 255, 255, 255, 255};
|
||||
uint8_t pins[OUTPUT_MAX_PINS] = {255, 255, 255, 255, 255};
|
||||
|
||||
unsigned ablMilliampsMax = request->arg(F("MA")).toInt();
|
||||
BusManager::setMilliampsMax(ablMilliampsMax);
|
||||
|
||||
@@ -92,7 +92,7 @@ void loadSettingsFromEEPROM()
|
||||
if (apHide > 1) apHide = 1;
|
||||
uint16_t length = EEPROM.read(229) + ((EEPROM.read(398) << 8) & 0xFF00); //was ledCount
|
||||
if (length > MAX_LEDS || length == 0) length = 30;
|
||||
uint8_t pins[5] = {2, 255, 255, 255, 255};
|
||||
uint8_t pins[OUTPUT_MAX_PINS] = {2, 255, 255, 255, 255};
|
||||
uint8_t colorOrder = COL_ORDER_GRB;
|
||||
if (lastEEPROMversion > 9) colorOrder = EEPROM.read(383);
|
||||
if (colorOrder > COL_ORDER_GBR) colorOrder = COL_ORDER_GRB;
|
||||
|
||||
Reference in New Issue
Block a user