Browse Source

fixed potential issue while set NRF pin to "off", added "default" behavior

pull/421/head
lumapu 2 years ago
parent
commit
e3e141ab57
  1. 4
      tools/esp8266/html/setup.html
  2. 6
      tools/esp8266/web.cpp

4
tools/esp8266/html/setup.html

@ -367,7 +367,7 @@
e.appendChild(lbl(p[1], p[0].toUpperCase()));
if("ESP8266" == type) {
e.appendChild(sel(p[1], [
[255, "off"],
[255, "off / default"],
[0, "D3 (GPIO0)"],
[1, "TX (GPIO1)"],
[2, "D4 (GPIO2)"],
@ -389,7 +389,7 @@
}
else {
e.appendChild(sel(p[1], [
[255, "off"],
[255, "off / default"],
[0, "GPIO0"],
[1, "TX (GPIO1)"],
[2, "GPIO2 (LED)"],

6
tools/esp8266/web.cpp

@ -393,9 +393,9 @@ void web::showSave(AsyncWebServerRequest *request) {
for(uint8_t i = 0; i < 5; i ++) {
pin = request->arg(String(pinArgNames[i])).toInt();
switch(i) {
default: mConfig->pinCs = pin; break;
case 1: mConfig->pinCe = pin; break;
case 2: mConfig->pinIrq = pin; break;
default: mConfig->pinCs = ((pin != 0xff) ? pin : DEF_CS_PIN); break;
case 1: mConfig->pinCe = ((pin != 0xff) ? pin : DEF_CE_PIN); break;
case 2: mConfig->pinIrq = ((pin != 0xff) ? pin : DEF_IRQ_PIN); break;
case 3: mConfig->led.led0 = pin; break;
case 4: mConfig->led.led1 = pin; break;
}

Loading…
Cancel
Save