@ -272,7 +272,7 @@
<!-- ENDIF_ESP32 -->
< / fieldset >
< / div >
<!-- IF_PLUGIN_DISPLAY -->
< button type = "button" class = "s_collapsible" > {#DISPLAY_CONFIG}< / button >
< div class = "s_content" >
< fieldset class = "mb-4" >
@ -301,6 +301,7 @@
< / div >
< / fieldset >
< / div >
<!-- ENDIF_PLUGIN_DISPLAY -->
< div class = "row mb-4 mt-4" >
< div class = "col-8 col-sm-3" > {#BTN_REBOOT_SUCCESSFUL_SAVE}< / div >
@ -341,6 +342,7 @@
var maxInv = 0;
var ts = 0;
/*IF_ESP8266*/
var esp8266pins = [
[255, "{#PIN_OFF}"],
[0, "D3 (GPIO0)"],
@ -361,6 +363,7 @@
[15, "D8 (GPIO15)"],
[16, "D0 (GPIO16 - {#PIN_NO_IRQ})"]
];
/*ENDIF_ESP8266*/
/*IF_ESP32*/
var esp32pins = [
@ -392,6 +395,7 @@
[36, "VP (GPIO36, {#PIN_INPUT_ONLY})"],
[39, "VN (GPIO39, {#PIN_INPUT_ONLY})"]
];
/*IF_ESP32-S2*/
var esp32sXpins = [
[255, "off / default"],
[0, "GPIO0 ({#PIN_DONT_USE} - BOOT)"],
@ -440,6 +444,58 @@
[47, "GPIO47"],
[48, "GPIO48"],
];
/*ENDIF_ESP32-S2*/
/*IF_ESP32-S3*/
var esp32sXpins = [
[255, "off / default"],
[0, "GPIO0 ({#PIN_DONT_USE} - BOOT)"],
[1, "GPIO1"],
[2, "GPIO2"],
[3, "GPIO3"],
[4, "GPIO4"],
[5, "GPIO5"],
[6, "GPIO6"],
[7, "GPIO7"],
[8, "GPIO8"],
[9, "GPIO9"],
[10, "GPIO10"],
[11, "GPIO11"],
[12, "GPIO12"],
[13, "GPIO13"],
[14, "GPIO14"],
[15, "GPIO15"],
[16, "GPIO16"],
[17, "GPIO17"],
[18, "GPIO18"],
[19, "GPIO19 ({#PIN_DONT_USE} - USB-)"],
[20, "GPIO20 ({#PIN_DONT_USE} - USB+)"],
[21, "GPIO21"],
[26, "GPIO26 (PSRAM - {#PIN_NOT_AVAIL})"],
[27, "GPIO27 (FLASH - {#PIN_NOT_AVAIL})"],
[28, "GPIO28 (FLASH - {#PIN_NOT_AVAIL})"],
[29, "GPIO29 (FLASH - {#PIN_NOT_AVAIL})"],
[30, "GPIO30 (FLASH - {#PIN_NOT_AVAIL})"],
[31, "GPIO31 (FLASH - {#PIN_NOT_AVAIL})"],
[32, "GPIO32 (FLASH - {#PIN_NOT_AVAIL})"],
[33, "GPIO33 (not exposed on S3-WROOM modules)"],
[34, "GPIO34 (not exposed on S3-WROOM modules)"],
[35, "GPIO35"],
[36, "GPIO36"],
[37, "GPIO37"],
[38, "GPIO38"],
[39, "GPIO39"],
[40, "GPIO40"],
[41, "GPIO41"],
[42, "GPIO42"],
[43, "GPIO43"],
[44, "GPIO44"],
[45, "GPIO45 ({#PIN_DONT_USE} - STRAPPING PIN)"],
[46, "GPIO46 ({#PIN_DONT_USE} - STRAPPING PIN)"],
[47, "GPIO47"],
[48, "GPIO48"],
];
/*ENDIF_ESP32-S3*/
/*IF_ESP32-C3*/
var esp32c3pins = [
[255, "off / default"],
[0, "GPIO0"],
@ -465,6 +521,7 @@
[20, "GPIO20 (RX)"],
[21, "GPIO21 (TX)"],
];
/*ENDIF_ESP32-C3*/
/*ENDIF_ESP32*/
var nrfPa = [
[0, "MIN ({#PIN_RECOMMENDED})"],
@ -890,11 +947,19 @@
function parsePinout(obj, type, system) {
var e = document.getElementById("pinout");
var pinList = esp8266pins;
/*IF_ESP32*/
var pinList = esp32pins;
if ("ESP32-S3" == system.chip_model || "ESP32-S2" == system.chip_model) pinList = esp32sXpins;
else if("ESP32-C3" == system["chip_model"]) pinList = esp32c3pins;
/*IF_ESP32-S2*/
pinList = esp32sXpins;
/*ENDIF_ESP32-S2*/
/*IF_ESP32-S3*/
pinList = esp32sXpins;
/*ENDIF_ESP32-S3*/
/*IF_ESP32-C3*/
pinList = esp32c3pins;
/*ENDIF_ESP32-C3*/
/*ELSE*/
var pinList = esp8266pins;
/*ENDIF_ESP32*/
pins = [['led0', 'pinLed0', '{#LED_AT_LEAST_ONE_PRODUCING}'], ['led1', 'pinLed1', '{#LED_MQTT_CONNECTED}'], ['led2', 'pinLed2', '{#LED_NIGHT_TIME}']];
for(p of pins) {
@ -926,11 +991,19 @@
var en = inp("nrfEnable", null, null, ["cb"], "nrfEnable", "checkbox");
en.checked = obj["en"];
var pinList = esp8266pins;
/*IF_ESP32*/
var pinList = esp32pins;
if ("ESP32-S3" == system.chip_model || "ESP32-S2" == system.chip_model) pinList = esp32sXpins;
else if("ESP32-C3" == system["chip_model"]) pinList = esp32c3pins;
/*IF_ESP32-S2*/
pinList = esp32sXpins;
/*ENDIF_ESP32-S2*/
/*IF_ESP32-S3*/
pinList = esp32sXpins;
/*ENDIF_ESP32-S3*/
/*IF_ESP32-C3*/
pinList = esp32c3pins;
/*ENDIF_ESP32-C3*/
/*ELSE*/
var pinList = esp8266pins;
/*ENDIF_ESP32*/
e.replaceChildren (
@ -962,8 +1035,15 @@
var e = document.getElementById("cmt");
var en = inp("cmtEnable", null, null, ["cb"], "cmtEnable", "checkbox");
var pinList = esp32pins;
if ("ESP32-S3" == system.chip_model || "ESP32-S2" == system.chip_model) pinList = esp32sXpins;
else if("ESP32-C3" == system["chip_model"]) pinList = esp32c3pins;
/*IF_ESP32-S2*/
pinList = esp32sXpins;
/*ENDIF_ESP32-S2*/
/*IF_ESP32-S3*/
pinList = esp32sXpins;
/*ENDIF_ESP32-S3*/
/*IF_ESP32-C3*/
pinList = esp32c3pins;
/*ENDIF_ESP32-C3*/
en.checked = obj["en"];
@ -1008,12 +1088,20 @@
}
}
/*IF_PLUGIN_DISPLAY*/
function parseDisplay(obj, type, system) {
var pinList = esp8266pins;
/*IF_ESP32*/
var pinList = esp32pins;
if ("ESP32-S3" == system.chip_model || "ESP32-S2" == system.chip_model) pinList = esp32sXpins;
else if("ESP32-C3" == system["chip_model"]) pinList = esp32c3pins;
/*IF_ESP32-S2*/
pinList = esp32sXpins;
/*ENDIF_ESP32-S2*/
/*IF_ESP32-S3*/
pinList = esp32sXpins;
/*ENDIF_ESP32-S3*/
/*IF_ESP32-C3*/
pinList = esp32c3pins;
/*ENDIF_ESP32-C3*/
/*ENDIF_ESP32*/
for(var i of ["disp_pwr"])
@ -1149,6 +1237,7 @@
setHide("screenSaver", !optionsMap.get(dispType)[2]);
setHide("pirPin", !(optionsMap.get(dispType)[2] & & (screenSaver==2))); // show pir pin only for motion screensaver
}
/*ENDIF_PLUGIN_DISPLAY*/
function tick() {
document.getElementById("date").innerHTML = toIsoDateStr((new Date((++ts) * 1000)));
@ -1168,7 +1257,9 @@
parseCmtRadio(root["radioCmt"], root["system"]["esp_type"], root["system"]);
/*ENDIF_ESP32*/
parseSerial(root["serial"]);
/*IF_PLUGIN_DISPLAY*/
parseDisplay(root["display"], root["system"]["esp_type"], root["system"]);
/*ENDIF_PLUGIN_DISPLAY*/
getAjax("/api/inverter/list", parseIv);
}
}