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
This commit is contained in:
@@ -58,6 +58,8 @@
|
|||||||
// function check(o,k) {} //WLEDMM not needed as we use dropdowns
|
// function check(o,k) {} //WLEDMM not needed as we use dropdowns
|
||||||
function getPins(o) {
|
function getPins(o) {
|
||||||
if (isO(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)) {
|
for (const [k,v] of Object.entries(o)) {
|
||||||
if (isO(v)) {
|
if (isO(v)) {
|
||||||
owner = k;
|
owner = k;
|
||||||
@@ -65,6 +67,10 @@
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (k.replace("[]","").substr(-3)=="pin") {
|
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)) {
|
if (Array.isArray(v)) {
|
||||||
for (var i=0; i<v.length; i++) if (v[i]>=0) { pins.push(v[i]); pinO.push(owner); }
|
for (var i=0; i<v.length; i++) if (v[i]>=0) { pins.push(v[i]); pinO.push(owner); }
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user