From fd079d61058d57c030018da2a907b36380f11f12 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Wed, 4 Feb 2026 22:19:42 +0100 Subject: [PATCH 1/5] 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. --- wled00/data/settings_um.htm | 2 ++ wled00/xml.cpp | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/wled00/data/settings_um.htm b/wled00/data/settings_um.htm index d0dd98f3d2..e6766d1f69 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 71f3340f93..8abb6ee685 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 From 53c396ecb16538279ccaed3a1c92d781de81b136 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Wed, 4 Feb 2026 22:42:43 +0100 Subject: [PATCH 2/5] styling move "Ax" label slightly to the right, "DMX " doesn't need extra space --- wled00/data/settings_um.htm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wled00/data/settings_um.htm b/wled00/data/settings_um.htm index e6766d1f69..8389bac883 100644 --- a/wled00/data/settings_um.htm +++ b/wled00/data/settings_um.htm @@ -270,7 +270,7 @@ for (let j=0; j max_gpio if (c.value > d.max_gpio) { select.removeChild(c); @@ -280,7 +280,7 @@ //https://www.javascripttutorial.net/javascript-dom/javascript-remove-items-from-a-select-conditionally/ if (c.text.length <= 4) c.text += " 🟢"; //2 digit number space and ⍼/⎌. If no reserved/read only/other um, then pin can be freely used (green) for (let jj=0; jj Date: Wed, 4 Feb 2026 22:55:19 +0100 Subject: [PATCH 3/5] initialize new pin arrays --- wled00/data/settings_um.htm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wled00/data/settings_um.htm b/wled00/data/settings_um.htm index 8389bac883..a9e6809fd3 100644 --- a/wled00/data/settings_um.htm +++ b/wled00/data/settings_um.htm @@ -10,6 +10,8 @@ d.um_p = []; d.rsvd = []; d.ro_gpio = []; + d.h_pins = []; + d.x_pins = []; var umCfg = {}; var pins = [], pinO = [], owner; var loc = false, locip; From d591ff8ab809db4d9d615b26dc9ca01b675e1193 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Wed, 4 Feb 2026 23:01:15 +0100 Subject: [PATCH 4/5] variable renamed for clarity isFirstHub => isFirstPin --- wled00/xml.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/wled00/xml.cpp b/wled00/xml.cpp index 8abb6ee685..2015952e25 100644 --- a/wled00/xml.cpp +++ b/wled00/xml.cpp @@ -290,11 +290,11 @@ void appendGPIOinfo() { // 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; + bool isFirstPin = 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; + sprintf(pinString, "%s%d", isFirstPin ? "" : ",", pinNr); + strcat(ro_gpio, pinString); isFirstPin = false; } } oappend(ro_gpio); @@ -302,11 +302,11 @@ void appendGPIOinfo() { // 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; + isFirstPin = 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; + sprintf(pinString, "%s%d", isFirstPin ? "" : ",", pinNr); + strcat(ro_gpio, pinString); isFirstPin = false; } } oappend(ro_gpio); From b7d81e7fca1506966a1a88cb3923c22253e97b1e Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Thu, 5 Feb 2026 00:07:22 +0100 Subject: [PATCH 5/5] bugfix for wrongly disabled PINs Skips pin arrays for special bus types where pin array doesn't contain GPIO numbers, but allows all other entries --- wled00/data/settings_um.htm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wled00/data/settings_um.htm b/wled00/data/settings_um.htm index a9e6809fd3..a2d867bef3 100644 --- a/wled00/data/settings_um.htm +++ b/wled00/data/settings_um.htm @@ -58,6 +58,8 @@ // function check(o,k) {} //WLEDMM not needed as we use dropdowns function getPins(o) { if (isO(o)) { + // If this object is a bus instance, extract the "type" field + let busType = o.type !== undefined ? o.type : -1; for (const [k,v] of Object.entries(o)) { if (isO(v)) { owner = k; @@ -65,6 +67,10 @@ continue; } if (k.replace("[]","").substr(-3)=="pin") { + // Skip pin arrays for special bus types where pin array doesn't contain GPIO numbers, but allow all other entries + if (busType >= 80 && busType < 96) continue; // Network buses - pin array stores IP address + if (busType >= 100 && busType <= 110) continue; // HUB75 buses - pin array stores chain length + if (Array.isArray(v)) { for (var i=0; i=0) { pins.push(v[i]); pinO.push(owner); } } else {