ESP32-S3 has different GPIO - allow using them in UI

This is a dirty hack, but I don't know enough about JS to make a clean solution.

- xml.cpp: -S3 has different "forbidden GPIO".
- LED settings & UM settings: temporarily disabled some "sorry PINS cannot be used" alerts. Changed maximum GPIO number to 48.
This commit is contained in:
Frank
2022-09-03 18:36:00 +02:00
parent 78d79be5a4
commit af2d8aab98
7 changed files with 4472 additions and 4468 deletions

View File

@@ -56,7 +56,7 @@
for (var i=0; i<pins.length; i++) {
if (k==pinO[i]) continue;
if (o.value==pins[i] && pinO[i]==="if") { o.style.color="lime"; break; }
if (o.value==pins[i] || o.value<-1 || o.value>39) { o.style.color="red"; break; } else o.style.color=o.value>33?"orange":"#fff";
if (o.value==pins[i] || o.value<-1 || o.value>48) { o.style.color="red"; break; } else o.style.color=o.value>48?"orange":"#fff";
}
} else {
switch (o.name) {
@@ -70,7 +70,7 @@
for (var i=0; i<pins.length; i++) {
if (k==pinO[i]) continue;
if (o.value==pins[i] && pinO[i]==="if") { o.style.color="lime"; break; }
if (o.value==pins[i] || o.value<-1 || o.value>39) { o.style.color="red"; break; } else o.style.color=o.value>33?"orange":"#fff";
if (o.value==pins[i] || o.value<-1 || o.value>48) { o.style.color="red"; break; } else o.style.color=o.value>48?"orange":"#fff";
}
}
}
@@ -115,7 +115,7 @@
case "number":
c = `value="${o}"`;
if (f.substr(-3)==="pin") {
c += ' max="39" min="-1" class="s"';
c += ' max="48" min="-1" class="s"';
t = "int";
} else {
c += ' step="any" class="xxl"';
@@ -237,14 +237,14 @@
<h2>Usermod Setup</h2>
Global I<sup>2</sup>C GPIOs (HW)<br>
<i style="color: orange;">(only changable on ESP32, change requires reboot!)</i><br>
SDA:<input type="number" min="-1" max="33" name="SDA" onchange="check(this,'if')" class="s" placeholder="SDA">
SCL:<input type="number" min="-1" max="33" name="SCL" onchange="check(this,'if')" class="s" placeholder="SCL">
SDA:<input type="number" min="-1" max="48" name="SDA" onchange="check(this,'if')" class="s" placeholder="SDA">
SCL:<input type="number" min="-1" max="48" name="SCL" onchange="check(this,'if')" class="s" placeholder="SCL">
<hr style="width:260px">
Global SPI GPIOs (HW)<br>
<i style="color: orange;">(only changable on ESP32, change requires reboot!)</i><br>
MOSI:<input type="number" min="-1" max="33" name="MOSI" onchange="check(this,'if')" class="s" placeholder="MOSI">
MISO:<input type="number" min="-1" max="33" name="MISO" onchange="check(this,'if')" class="s" placeholder="MISO">
SCLK:<input type="number" min="-1" max="33" name="SCLK" onchange="check(this,'if')" class="s" placeholder="SCLK">
MOSI:<input type="number" min="-1" max="48" name="MOSI" onchange="check(this,'if')" class="s" placeholder="MOSI">
MISO:<input type="number" min="-1" max="48" name="MISO" onchange="check(this,'if')" class="s" placeholder="MISO">
SCLK:<input type="number" min="-1" max="48" name="SCLK" onchange="check(this,'if')" class="s" placeholder="SCLK">
</div>
<div id="um">Loading settings...</div>
<hr><button type="button" onclick="B()">Back</button><button type="submit">Save</button>