bus robustness improvement

ABL and SerializeConfig explicitly check bus->isOK(), instead of relying on bus->getLength() == 0
This commit is contained in:
Frank
2025-11-16 14:52:18 +01:00
parent 5b52ee612f
commit 737b7cc471
2 changed files with 2 additions and 1 deletions

View File

@@ -2052,6 +2052,7 @@ void WS2812FX::estimateCurrentAndLimitBri() {
for (uint_fast8_t bNum = 0; bNum < busses.getNumBusses(); bNum++) {
Bus *bus = busses.getBus(bNum);
if (!bus || !bus->isOk()) continue; // WLEDMM skip busses that are not initialized yet
auto btype = bus->getType();
if (EXCLUDE_FROM_ABL(btype)) continue; // WLEDMM exclude non-ABL and network busses
uint16_t len = bus->getLength();

View File

@@ -817,7 +817,7 @@ void serializeConfig() {
for (uint8_t s = 0; s < busses.getNumBusses(); s++) {
Bus *bus = busses.getBus(s);
if (!bus || bus->getLength()==0) break;
if (!bus || !bus->isOk() || bus->getLength()==0) break; // WLEDMM exclude not initialized busses
JsonObject ins = hw_led_ins.createNestedObject();
ins["start"] = bus->getStart();
ins["len"] = bus->getLength();