Skip to content

Commit 087816a

Browse files
committed
fixing save
1 parent 7792e2d commit 087816a

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

qml/Functions.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function loadPinmux()
4141
pin.info = ["reserved"]
4242
pin.type = "reserved"
4343
pin.description = ""
44-
pin.overlay = ""
44+
pin.overlay = []
4545
pin.gpioDirection = "unmodified"
4646
pin.gpioValue = "unmodified"
4747
pin.kernelPinNumber = 0
@@ -342,9 +342,17 @@ function saveConfig(fileName) {
342342
var sourcePin = portList[i].pinList[j]
343343
var pin = j+1
344344

345-
if ((sourcePin.overlay === "") || (sourcePin.type === "reserved")) // this is a reserved pin
345+
if ((sourcePin.overlay === []) || (sourcePin.type === "reserved")) // this is a reserved pin
346346
continue
347-
if (sourcePin.loadedOverlays.indexOf(sourcePin.overlay) === -1) // overlay not loaded
347+
348+
var contained = false
349+
for (var k = 0; k < sourcePin.overlay.length; ++k) {
350+
if (sourcePin.loadedOverlays.indexOf(sourcePin.overlay[k]) !== -1) { // overlay not loaded
351+
contained = true
352+
break
353+
}
354+
}
355+
if (!contained) // overlay not loaded
348356
continue
349357

350358
var pinName = "P" + port + "_" + pin

0 commit comments

Comments
 (0)