add HUB75 and DMX pins to usermods pin dropdown

these pins were wrongly shown as "available", because the are not stored in the cfg.json part related to LEDs settings.
This commit is contained in:
Frank
2026-02-04 22:19:42 +01:00
parent 30ce4c55ba
commit fd079d6105
2 changed files with 26 additions and 0 deletions

View File

@@ -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