mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-13 17:06:39 +02:00
added different pinout for ESP32 #286
This commit is contained in:
parent
427d1a9ba5
commit
202d883f38
2 changed files with 58 additions and 21 deletions
|
@ -290,30 +290,62 @@
|
||||||
document.getElementsByName("sunDisNightCom")[0].checked = obj["disnightcom"];
|
document.getElementsByName("sunDisNightCom")[0].checked = obj["disnightcom"];
|
||||||
}
|
}
|
||||||
|
|
||||||
function parsePinout(obj) {
|
function parsePinout(obj, type) {
|
||||||
var e = document.getElementById("pinout");
|
var e = document.getElementById("pinout");
|
||||||
pins = [['cs', 'pinCs'], ['ce', 'pinCe'], ['irq', 'pinIrq']];
|
pins = [['cs', 'pinCs'], ['ce', 'pinCe'], ['irq', 'pinIrq']];
|
||||||
for(p of pins) {
|
for(p of pins) {
|
||||||
e.appendChild(lbl(p[1], p[0].toUpperCase()));
|
e.appendChild(lbl(p[1], p[0].toUpperCase()));
|
||||||
e.appendChild(sel(p[1], [
|
if("ESP8266" == type) {
|
||||||
[0, "D3 (GPIO0)"],
|
e.appendChild(sel(p[1], [
|
||||||
[1, "TX (GPIO1)"],
|
[0, "D3 (GPIO0)"],
|
||||||
[2, "D4 (GPIO2)"],
|
[1, "TX (GPIO1)"],
|
||||||
[3, "RX (GPIO3)"],
|
[2, "D4 (GPIO2)"],
|
||||||
[4, "D2 (GPIO4)"],
|
[3, "RX (GPIO3)"],
|
||||||
[5, "D1 (GPIO5)"],
|
[4, "D2 (GPIO4)"],
|
||||||
[6, "GPIO6"],
|
[5, "D1 (GPIO5)"],
|
||||||
[7, "GPIO7"],
|
[6, "GPIO6"],
|
||||||
[8, "GPIO8"],
|
[7, "GPIO7"],
|
||||||
[9, "GPIO9"],
|
[8, "GPIO8"],
|
||||||
[10, "GPIO10"],
|
[9, "GPIO9"],
|
||||||
[11, "GPIO11"],
|
[10, "GPIO10"],
|
||||||
[12, "D6 (GPIO12)"],
|
[11, "GPIO11"],
|
||||||
[13, "D7 (GPIO13)"],
|
[12, "D6 (GPIO12)"],
|
||||||
[14, "D5 (GPIO14)"],
|
[13, "D7 (GPIO13)"],
|
||||||
[15, "D8 (GPIO15)"],
|
[14, "D5 (GPIO14)"],
|
||||||
[16, "D0 (GPIO16 - no IRQ!)"]
|
[15, "D8 (GPIO15)"],
|
||||||
], obj[p[0]]));
|
[16, "D0 (GPIO16 - no IRQ!)"]
|
||||||
|
], obj[p[0]]));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
e.appendChild(sel(p[1], [
|
||||||
|
[0, "GPIO0"],
|
||||||
|
[1, "TXD (GPIO1)"],
|
||||||
|
[2, "D2 (LED)"],
|
||||||
|
[3, "RXD (GPIO3)"],
|
||||||
|
[4, "D4"],
|
||||||
|
[5, "D5"],
|
||||||
|
[12, "D12"],
|
||||||
|
[13, "D13"],
|
||||||
|
[14, "D14"],
|
||||||
|
[15, "D15"],
|
||||||
|
[16, "RX2 (GPIO16)"],
|
||||||
|
[17, "TX2 (GPIO17)"],
|
||||||
|
[18, "D18"],
|
||||||
|
[19, "D19"],
|
||||||
|
[21, "D21"],
|
||||||
|
[22, "D22"],
|
||||||
|
[23, "D23"],
|
||||||
|
[25, "D25"],
|
||||||
|
[26, "D26"],
|
||||||
|
[27, "D27"],
|
||||||
|
[32, "D32"],
|
||||||
|
[33, "D33"],
|
||||||
|
[34, "D34"],
|
||||||
|
[35, "D35"],
|
||||||
|
[36, "VP (GPIO36)"],
|
||||||
|
[39, "VN (GPIO39)"]
|
||||||
|
], obj[p[0]]));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -341,7 +373,7 @@
|
||||||
parseMqtt(root["mqtt"]);
|
parseMqtt(root["mqtt"]);
|
||||||
parseNtp(root["ntp"]);
|
parseNtp(root["ntp"]);
|
||||||
parseSun(root["sun"]);
|
parseSun(root["sun"]);
|
||||||
parsePinout(root["pinout"]);
|
parsePinout(root["pinout"], root["system"]["esp_type"]);
|
||||||
parseRadio(root["radio"]);
|
parseRadio(root["radio"]);
|
||||||
parseSerial(root["serial"]);
|
parseSerial(root["serial"]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -147,6 +147,11 @@ void webApi::getSystem(JsonObject obj) {
|
||||||
obj[F("ts_sun_upd")] = mApp->getLatestSunTimestamp();
|
obj[F("ts_sun_upd")] = mApp->getLatestSunTimestamp();
|
||||||
obj[F("wifi_rssi")] = WiFi.RSSI();
|
obj[F("wifi_rssi")] = WiFi.RSSI();
|
||||||
obj[F("disclaimer")] = mConfig->disclaimer;
|
obj[F("disclaimer")] = mConfig->disclaimer;
|
||||||
|
#if defined(ESP32)
|
||||||
|
obj[F("esp_type")] = F("ESP32");
|
||||||
|
#else
|
||||||
|
obj[F("esp_type")] = F("ESP8266");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue