Skip to content

Commit

Permalink
Always copy all the pin data
Browse files Browse the repository at this point in the history
  • Loading branch information
netmindz committed Sep 22, 2024
1 parent 713cbb8 commit b7aba15
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion usermods/rgb-rotary-encoder/rgb-rotary-encoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion wled00/bus_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

Expand Down
2 changes: 1 addition & 1 deletion wled00/cfg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
2 changes: 1 addition & 1 deletion wled00/set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion wled00/wled_eeprom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b7aba15

Please sign in to comment.