|
|
@ -173,6 +173,9 @@ |
|
|
|
<p class="des">Radio (NRF24L01+)</p> |
|
|
|
<div id="rf24"></div> |
|
|
|
|
|
|
|
<p class="des">Radio (CMT2300A)</p> |
|
|
|
<div id="cmt"></div> |
|
|
|
|
|
|
|
<p class="des">Serial Console</p> |
|
|
|
<label for="serEn">print inverter data</label> |
|
|
|
<input type="checkbox" class="cb" name="serEn"/><br/> |
|
|
@ -408,6 +411,11 @@ |
|
|
|
case "6": max = 4; break; |
|
|
|
} |
|
|
|
} |
|
|
|
else if(serial.charAt(2) == 6) { |
|
|
|
switch(serial.charAt(3) == 4) { |
|
|
|
case "4": max = 4; break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -519,22 +527,56 @@ |
|
|
|
|
|
|
|
function parsePinout(obj, type) { |
|
|
|
var e = document.getElementById("pinout"); |
|
|
|
pins = [['cs', 'pinCs'], ['ce', 'pinCe'], ['irq', 'pinIrq'], ['led0', 'pinLed0'], ['led1', 'pinLed1']]; |
|
|
|
pins = [['led0', 'pinLed0'], ['led1', 'pinLed1']]; |
|
|
|
for(p of pins) { |
|
|
|
e.appendChild(lbl(p[1], p[0].toUpperCase())); |
|
|
|
e.appendChild(sel(p[1], ("ESP8266" == type) ? esp8266pins : esp32pins, obj[p[0]])); |
|
|
|
e.append( |
|
|
|
lbl(p[1], p[0].toUpperCase()), |
|
|
|
sel(p[1], ("ESP8266" == type) ? esp8266pins : esp32pins, obj[p[0]]) |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function parseRadio(obj) { |
|
|
|
function parseNrfRadio(obj) { |
|
|
|
var e = document.getElementById("rf24"); |
|
|
|
e.appendChild(lbl("rf24Power", "Amplifier Power Level")); |
|
|
|
e.appendChild(sel("rf24Power", [ |
|
|
|
[0, "MIN"], |
|
|
|
[1, "LOW"], |
|
|
|
[2, "HIGH"], |
|
|
|
[3, "MAX"] |
|
|
|
], obj["power_level"])); |
|
|
|
var en = inp("rf24Enable", null, null, ["cb"], "rf24Enable", "checkbox"); |
|
|
|
en.checked = obj["en"]; |
|
|
|
|
|
|
|
e.append( |
|
|
|
lbl("rf24Enable", "NRF24 Radio Enable"), |
|
|
|
en, |
|
|
|
lbl("rf24Power", "Amplifier Power Level"), |
|
|
|
sel("rf24Power", [ |
|
|
|
[0, "MIN"], |
|
|
|
[1, "LOW"], |
|
|
|
[2, "HIGH"], |
|
|
|
[3, "MAX"] |
|
|
|
], obj["power_level"]) |
|
|
|
); |
|
|
|
pins = [['cs', 'pinCs'], ['ce', 'pinCe'], ['irq', 'pinIrq']]; |
|
|
|
for(p of pins) { |
|
|
|
e.append( |
|
|
|
lbl(p[1], p[0].toUpperCase()), |
|
|
|
sel(p[1], ("ESP8266" == type) ? esp8266pins : esp32pins, obj[p[0]]) |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function parseCmtRadio(obj) { |
|
|
|
var e = document.getElementById("cmt"); |
|
|
|
var en = inp("cmtEnable", null, null, ["cb"], "cmtEnable", "checkbox"); |
|
|
|
en.checked = obj["en"]; |
|
|
|
|
|
|
|
e.append( |
|
|
|
lbl("cmtEnable", "CMT2300A Radio Enable"), |
|
|
|
en |
|
|
|
); |
|
|
|
pins = [['csb', 'pinCsb'], ['fcsb', 'pinFcsb'], ['irq', 'pinGpio3']]; |
|
|
|
for(p of pins) { |
|
|
|
e.append( |
|
|
|
lbl(p[1], p[0].toUpperCase()), |
|
|
|
sel(p[1], ("ESP8266" == type) ? esp8266pins : esp32pins, obj[p[0]]) |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function parseSerial(obj) { |
|
|
@ -577,7 +619,9 @@ |
|
|
|
parseNtp(root["ntp"]); |
|
|
|
parseSun(root["sun"]); |
|
|
|
parsePinout(root["pinout"], root["system"]["esp_type"]); |
|
|
|
parseRadio(root["radio"]); |
|
|
|
parseNrfRadio(root["radioNrf"]); |
|
|
|
if(root["generic"]["esp_type"] == "ESP32") |
|
|
|
parseCmtRadio(root["radioCmt"]); |
|
|
|
parseSerial(root["serial"]); |
|
|
|
parseDisplay(root["display"], root["system"]["esp_type"]); |
|
|
|
} |
|
|
|