bus robustness improvement
ABL and SerializeConfig explicitly check bus->isOK(), instead of relying on bus->getLength() == 0
This commit is contained in:
@@ -2052,6 +2052,7 @@ void WS2812FX::estimateCurrentAndLimitBri() {
|
|||||||
|
|
||||||
for (uint_fast8_t bNum = 0; bNum < busses.getNumBusses(); bNum++) {
|
for (uint_fast8_t bNum = 0; bNum < busses.getNumBusses(); bNum++) {
|
||||||
Bus *bus = busses.getBus(bNum);
|
Bus *bus = busses.getBus(bNum);
|
||||||
|
if (!bus || !bus->isOk()) continue; // WLEDMM skip busses that are not initialized yet
|
||||||
auto btype = bus->getType();
|
auto btype = bus->getType();
|
||||||
if (EXCLUDE_FROM_ABL(btype)) continue; // WLEDMM exclude non-ABL and network busses
|
if (EXCLUDE_FROM_ABL(btype)) continue; // WLEDMM exclude non-ABL and network busses
|
||||||
uint16_t len = bus->getLength();
|
uint16_t len = bus->getLength();
|
||||||
|
|||||||
@@ -817,7 +817,7 @@ void serializeConfig() {
|
|||||||
|
|
||||||
for (uint8_t s = 0; s < busses.getNumBusses(); s++) {
|
for (uint8_t s = 0; s < busses.getNumBusses(); s++) {
|
||||||
Bus *bus = busses.getBus(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();
|
JsonObject ins = hw_led_ins.createNestedObject();
|
||||||
ins["start"] = bus->getStart();
|
ins["start"] = bus->getStart();
|
||||||
ins["len"] = bus->getLength();
|
ins["len"] = bus->getLength();
|
||||||
|
|||||||
Reference in New Issue
Block a user