some small tweaks

This commit is contained in:
Nic Limper
2024-12-17 19:20:17 +01:00
parent 23cbadb9f6
commit 7e49c2a09e
9 changed files with 28 additions and 15 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -1378,8 +1378,7 @@ bool getCalFeed(String &filename, JsonObject &cfgobj, tagRecord *&taginfo, imgPa
if (loc["colors1"].is<JsonArray>() && loc["colors1"].size() > calendarId) {
background = getColor(loc["colors1"][calendarId]);
border = getColor(loc["colors2"][calendarId]);
textcolor = getColor(loc["colors3"][calendarId]);
Serial.println("cal " + String(calendarId) + ": " + String(loc["colors2"][calendarId]));
if (loc["colors3"][calendarId]) textcolor = getColor(loc["colors3"][calendarId]);
}
spr.fillRect(eventX - 1, eventY - 2, colWidth * (fulldayend - fulldaystart) - 3, lineHeight - 1, background);
spr.drawRect(eventX - 2, eventY - 3, colWidth * (fulldayend - fulldaystart) - 1, lineHeight + 1, border);
@@ -1459,8 +1458,7 @@ bool getCalFeed(String &filename, JsonObject &cfgobj, tagRecord *&taginfo, imgPa
if (loc["colors1"].is<JsonArray>() && loc["colors1"].size() > calendarId) {
background = getColor(loc["colors1"][calendarId]);
border = getColor(loc["colors2"][calendarId]);
textcolor = getColor(loc["colors3"][calendarId]);
Serial.println("cal " + String(calendarId) + ": " + String(loc["colors2"][calendarId]));
if (loc["colors3"][calendarId]) textcolor = getColor(loc["colors3"][calendarId]);
}
spr.fillRect(eventX + 2, eventY + 1, colWidth - 3, (duration * hourHeight / 60) - 1, background);
spr.drawRect(eventX + 1, eventY, colWidth - 1, (duration * hourHeight / 60) + 1, border);
@@ -2295,6 +2293,14 @@ void drawElement(const JsonObject &element, TFT_eSprite &spr, imgParam &imagePar
} else if (element.containsKey("circle")) {
const JsonArray &circleArray = element["circle"];
spr.fillCircle(circleArray[0].as<int>(), circleArray[1].as<int>(), circleArray[2].as<int>(), getColor(circleArray[3]));
if (circleArray.size() >= 6) {
for (int i = 0; i < circleArray[5].as<int>(); i++) {
spr.drawCircle(circleArray[0].as<int>(), circleArray[1].as<int>(), circleArray[2].as<int>() - i, getColor(circleArray[4]));
if (i > 0) {
spr.drawCircle(circleArray[0].as<int>(), circleArray[1].as<int>(), circleArray[2].as<int>() - i - 0.5, getColor(circleArray[4]));
}
}
}
} else if (element.containsKey("image")) {
const JsonArray &imgArray = element["image"];

View File

@@ -986,15 +986,17 @@ bool queueDataAvail(struct pendingData* pending, bool local) {
taginfo->data = nullptr;
} else {
newPending.data = nullptr;
// optional: read data early, don't wait for block request.
fs::File file = contentFS->open(newPending.filename);
if (file) {
newPending.data = getDataForFile(file);
Serial.println("Reading file " + String(newPending.filename));
file.close();
} else {
Serial.println("Warning: not found: " + String(newPending.filename));
if (pendingQueue.size() < 5) { // maximized to 5 to save some memory
// optional: read data early, don't wait for block request.
fs::File file = contentFS->open(newPending.filename);
if (file) {
newPending.data = getDataForFile(file);
Serial.println("Reading file " + String(newPending.filename));
file.close();
} else {
Serial.println("Warning: not found: " + String(newPending.filename));
}
}
}
newPending.len = taginfo->len;

View File

@@ -43,6 +43,7 @@ void handleSysinfoRequest(AsyncWebServerRequest* request) {
doc["rollback"] = Update.canRollBack();
#if defined C6_OTA_FLASHING
doc["hasC6"] = 1;
doc["C6version"] = apInfo.version;
#else
doc["hasC6"] = 0;
#endif

View File

@@ -31,8 +31,6 @@
#include "webflasher.h"
#endif
extern uint8_t data_to_send[];
AsyncWebServer server(80);
AsyncWebSocket ws("/ws");
WifiManager wm;

View File

@@ -1795,6 +1795,9 @@ function populateAPInfo(apip) {
version += `esp32 version: ${data.buildversion}<br>`;
version += `psram size: ${data.psramsize}<br>`;
version += `flash size: ${data.flashsize}<br>`;
if (data.hasC6) {
version += `ESP-C6/H2 version: 0x${parseInt(data.C6version).toString(16).toUpperCase()}<br>`;
}
$('#ap' + apid + ' .apswversion').innerHTML = version;
}
})

View File

@@ -62,6 +62,9 @@ export async function initUpdate() {
print(`filesystem version: ${filesystemversion}`);
print(`psram size: ${sdata.psramsize}`);
print(`flash size: ${sdata.flashsize}`);
if (sdata.hasC6) {
print(`ESP-C6/H2 version: 0x${parseInt(sdata.C6version).toString(16).toUpperCase()}`);
}
print("--------------------------", "gray");
env = apConfig.env || sdata.env;
if (sdata.env != env) {