Further improve ESP32 support

This commit is contained in:
huskee 2023-12-24 02:10:08 +02:00
parent 771ca851c8
commit 1925493a7e
9 changed files with 116 additions and 15 deletions

View file

@ -1,3 +1,14 @@
fetch("/isESP32")
.then((res) => res.text())
.then((textResponse) => {
let isESP32 = textResponse;
});
fetch("/int")
.then((res) => res.text())
.then((textResponse) => {
document.querySelector("#updInt").innerText = textResponse;
});
const canvasA = document.querySelector("#chartA"); const canvasA = document.querySelector("#chartA");
const canvasB = document.querySelector("#chartB"); const canvasB = document.querySelector("#chartB");
const chartUpdateInt = document.querySelector("#chartUpd").value; const chartUpdateInt = document.querySelector("#chartUpd").value;
@ -82,12 +93,6 @@ const options = {
}, },
}; };
fetch("/int")
.then((res) => res.text())
.then((textResponse) => {
document.querySelector("#updInt").innerText = textResponse;
});
document.querySelector("#cupdInt").innerText = chartUpdateInt; document.querySelector("#cupdInt").innerText = chartUpdateInt;
document.querySelector("#recInfo").style.display = "none"; document.querySelector("#recInfo").style.display = "none";
const chartA = new Chart(canvasA, { const chartA = new Chart(canvasA, {
@ -285,19 +290,21 @@ function startRecording() {
} }
} }
function startTimer(duration, display) { function startTimer(duration, display) {
var timer = duration, minutes, seconds; var timer = duration,
minutes,
seconds;
setInterval(function () { setInterval(function () {
minutes = parseInt(timer / 60, 10); minutes = parseInt(timer / 60, 10);
seconds = parseInt(timer % 60, 10); seconds = parseInt(timer % 60, 10);
minutes = minutes < 10 ? "0" + minutes : minutes; minutes = minutes < 10 ? "0" + minutes : minutes;
seconds = seconds < 10 ? "0" + seconds : seconds; seconds = seconds < 10 ? "0" + seconds : seconds;
display.textContent = minutes + ":" + seconds; display.textContent = minutes + ":" + seconds;
if (--timer < 0) { if (--timer < 0) {
timer = duration; timer = duration;
} }
}, 1000); }, 1000);
} }
function fancyTimeFormat(e) { function fancyTimeFormat(e) {

View file

@ -0,0 +1 @@
/home/huskee/therminator/schematics/_autosave-therminator.kicad_sch

View file

@ -0,0 +1,14 @@
(kicad_sch (version 20230121) (generator eeschema)
(uuid d7e42dbb-653f-4efa-bd53-9e9970955c51)
(paper "A4")
(lib_symbols
)
(sheet_instances
(path "/" (page "1"))
)
)

View file

@ -0,0 +1,2 @@
(kicad_pcb (version 20221018) (generator pcbnew)
)

View file

@ -0,0 +1,61 @@
{
"board": {
"design_settings": {
"defaults": {
"board_outline_line_width": 0.1,
"copper_line_width": 0.2,
"copper_text_size_h": 1.5,
"copper_text_size_v": 1.5,
"copper_text_thickness": 0.3,
"other_line_width": 0.15,
"silk_line_width": 0.15,
"silk_text_size_h": 1.0,
"silk_text_size_v": 1.0,
"silk_text_thickness": 0.15
},
"diff_pair_dimensions": [],
"drc_exclusions": [],
"rules": {
"min_copper_edge_clearance": 0.0,
"solder_mask_clearance": 0.0,
"solder_mask_min_width": 0.0
},
"track_widths": [],
"via_dimensions": []
}
},
"boards": [],
"libraries": {
"pinned_footprint_libs": [],
"pinned_symbol_libs": []
},
"meta": {
"filename": "kicad.kicad_pro",
"version": 1
},
"net_settings": {
"classes": [
{
"clearance": 0.2,
"diff_pair_gap": 0.25,
"diff_pair_via_gap": 0.25,
"diff_pair_width": 0.2,
"microvia_diameter": 0.3,
"microvia_drill": 0.1,
"name": "Default",
"nets": [],
"track_width": 0.25,
"via_diameter": 0.8,
"via_drill": 0.4
}
],
"meta": {
"version": 0
}
},
"pcbnew": {
"page_layout_descr_file": ""
},
"sheets": [],
"text_variables": {}
}

View file

@ -0,0 +1,5 @@
(kicad_sch (version 20230121) (generator eeschema)
(paper "A4")
(lib_symbols)
(symbol_instances)
)

View file

@ -0,0 +1 @@
{"hostname":"selene","username":"huskee"}

View file

@ -0,0 +1 @@
{"hostname":"selene","username":"huskee"}

View file

@ -160,6 +160,15 @@ void initWebServer() {
server.on("/int", HTTP_GET, [](AsyncWebServerRequest *request) { server.on("/int", HTTP_GET, [](AsyncWebServerRequest *request) {
request->send_P(200, "text/plain", String(timerDelay).c_str()); request->send_P(200, "text/plain", String(timerDelay).c_str());
}); });
#ifdef ESP32
server.on("/isESP32", HTTP_GET, [](AsyncWebServerRequest *request) {
request->send(200, "text/plain", String(true));
});
#else
server.on("/isESP32", HTTP_GET, [](AsyncWebServerRequest *request) {
request->send(200, "text/plain", String(false));
});
#endif
server.serveStatic("/", LittleFS, "/"); server.serveStatic("/", LittleFS, "/");
server.begin(); server.begin();
Serial.printf("webserver init\n"); Serial.printf("webserver init\n");