diff --git a/wled00/data/settings_um.htm b/wled00/data/settings_um.htm index d0dd98f3..e6766d1f 100644 --- a/wled00/data/settings_um.htm +++ b/wled00/data/settings_um.htm @@ -269,6 +269,8 @@ // console.log("pinPost option", c, c.value, d.ro_gpio.includes(c.value)); for (let j=0; j max_gpio if (c.value > d.max_gpio) { select.removeChild(c); diff --git a/wled00/xml.cpp b/wled00/xml.cpp index 71f3340f..8abb6ee6 100644 --- a/wled00/xml.cpp +++ b/wled00/xml.cpp @@ -287,6 +287,30 @@ void appendGPIOinfo() { char a_pins[64] = { '\0' }; // fix warning: output 45 bytes into a destination of size 30 snprintf(a_pins, 64, "d.a_pins=[%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d];", pinManager.getADCPin(PM_ADC1, 0), pinManager.getADCPin(PM_ADC1, 1), pinManager.getADCPin(PM_ADC1, 2), pinManager.getADCPin(PM_ADC1, 3), pinManager.getADCPin(PM_ADC1, 4), pinManager.getADCPin(PM_ADC1, 5), pinManager.getADCPin(PM_ADC1, 6), pinManager.getADCPin(PM_ADC1, 7), pinManager.getADCPin(PM_ADC1, 8), pinManager.getADCPin(PM_ADC1, 9), pinManager.getADCPin(PM_ADC1, 10)); oappend(a_pins); + + // WLEDMM add HUB75 pins, as they are not stored directly in cfg.json + strcpy(ro_gpio, "d.h_pins=["); // WLEDMM we re-use this array, instead of creating an addition one; 140 bytes is more than enough for 14 pins. + bool isFirstHub = true; + for(int pinNr = 0; pinNr < WLED_NUM_PINS; pinNr++) { + if ((pinManager.isPinOk(pinNr)) && (pinManager.getPinOwner(pinNr) == PinOwner::HUB75)) { + sprintf(pinString, "%s%d", isFirstHub?"":",", pinNr); + strcat(ro_gpio, pinString); isFirstHub = false; + } + } + oappend(ro_gpio); + oappend(SET_F("];")); + + // WLEDMM same procedure for DMX pins + strcpy(ro_gpio, "d.x_pins=["); // WLEDMM we re-use this array, instead of creating an addition one; 140 bytes is more than enough for max 4 pins. + isFirstHub = true; + for(int pinNr = 0; pinNr < WLED_NUM_PINS; pinNr++) { + if ((pinManager.isPinOk(pinNr)) && (pinManager.getPinOwner(pinNr) == PinOwner::DMX || pinManager.getPinOwner(pinNr) == PinOwner::DMX_INPUT)) { + sprintf(pinString, "%s%d", isFirstHub?"":",", pinNr); + strcat(ro_gpio, pinString); isFirstHub = false; + } + } + oappend(ro_gpio); + oappend(SET_F("];")); } //get values for settings form in javascript