C
Refine RPM bar and refresh installer 1.2.6
YU CHIH CHANGd341e9b031ba
diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.ymlindex 5b51537..c870f03 100644--- a/.github/workflows/deploy-pages.yml+++ b/.github/workflows/deploy-pages.yml@@ -90,8 +90,8 @@ jobs:const releaseIndex = JSON.parse(await readFile(releasesPath, "utf8"));const releases = Array.isArray(releaseIndex.versions) ? releaseIndex.versions : [];- if (releases.length === 0 || releases.length > 5) {- throw new Error("installer/releases.json must contain between 1 and 5 versions.");+ if (releases.length === 0 || releases.length > 10) {+ throw new Error("installer/releases.json must contain between 1 and 10 versions.");}const manifestPaths = [diff --git a/VERSION b/VERSIONindex c813fe1..3c43790 100644--- a/VERSION+++ b/VERSION@@ -1 +1 @@-1.2.5+1.2.6diff --git a/installer/firmware/firmware-ili9341.bin b/installer/firmware/firmware-ili9341.binindex 4fe2347..6d95787 100644Binary files a/installer/firmware/firmware-ili9341.bin and b/installer/firmware/firmware-ili9341.bin differdiff --git a/installer/firmware/firmware-st7789.bin b/installer/firmware/firmware-st7789.binindex 3212d22..304cd74 100644Binary files a/installer/firmware/firmware-st7789.bin and b/installer/firmware/firmware-st7789.bin differdiff --git a/installer/index.html b/installer/index.htmlindex 2cc3697..0f14677 100644--- a/installer/index.html+++ b/installer/index.html@@ -594,7 +594,7 @@return response.json();}).then((releaseIndex) => {- releases = releaseIndex.versions.slice(0, 5);+ releases = releaseIndex.versions.slice(0, 10);selectedVersion = releases[0]?.version ?? "";selectManifest();})diff --git a/installer/releases.json b/installer/releases.jsonindex f810f71..4f8e8fc 100644--- a/installer/releases.json+++ b/installer/releases.json@@ -6,8 +6,8 @@"Introduced the refined low-RAM GT3 dashboard UI."],"manifests": {- "ili9341": "manifest.json",- "st7789": "manifest-st7789.json"+ "ili9341": "versions/1.2.6/manifest-ili9341.json",+ "st7789": "versions/1.2.6/manifest-st7789.json"}},{diff --git a/installer/versions/1.2.6/boot_app0.bin b/installer/versions/1.2.6/boot_app0.binnew file mode 100644index 0000000..13562caBinary files /dev/null and b/installer/versions/1.2.6/boot_app0.bin differdiff --git a/installer/versions/1.2.6/bootloader.bin b/installer/versions/1.2.6/bootloader.binnew file mode 100644index 0000000..d592359Binary files /dev/null and b/installer/versions/1.2.6/bootloader.bin differdiff --git a/installer/versions/1.2.6/firmware-ili9341.bin b/installer/versions/1.2.6/firmware-ili9341.binnew file mode 100644index 0000000..6d95787Binary files /dev/null and b/installer/versions/1.2.6/firmware-ili9341.bin differdiff --git a/installer/versions/1.2.6/firmware-st7789.bin b/installer/versions/1.2.6/firmware-st7789.binnew file mode 100644index 0000000..304cd74Binary files /dev/null and b/installer/versions/1.2.6/firmware-st7789.bin differdiff --git a/installer/versions/1.2.6/manifest-ili9341.json b/installer/versions/1.2.6/manifest-ili9341.jsonnew file mode 100644index 0000000..1946346--- /dev/null+++ b/installer/versions/1.2.6/manifest-ili9341.json@@ -0,0 +1,28 @@+{+ "name": "ESP32 GT7 Dashboard (ILI9341)",+ "version": "1.2.6",+ "new_install_prompt_erase": true,+ "builds": [+ {+ "chipFamily": "ESP32",+ "parts": [+ {+ "path": "bootloader.bin",+ "offset": 4096+ },+ {+ "path": "partitions.bin",+ "offset": 32768+ },+ {+ "path": "boot_app0.bin",+ "offset": 57344+ },+ {+ "path": "firmware-ili9341.bin",+ "offset": 65536+ }+ ]+ }+ ]+}diff --git a/installer/versions/1.2.6/manifest-st7789.json b/installer/versions/1.2.6/manifest-st7789.jsonnew file mode 100644index 0000000..abdfc2c--- /dev/null+++ b/installer/versions/1.2.6/manifest-st7789.json@@ -0,0 +1,28 @@+{+ "name": "ESP32 GT7 Dashboard (ST7789)",+ "version": "1.2.6",+ "new_install_prompt_erase": true,+ "builds": [+ {+ "chipFamily": "ESP32",+ "parts": [+ {+ "path": "bootloader.bin",+ "offset": 4096+ },+ {+ "path": "partitions.bin",+ "offset": 32768+ },+ {+ "path": "boot_app0.bin",+ "offset": 57344+ },+ {+ "path": "firmware-st7789.bin",+ "offset": 65536+ }+ ]+ }+ ]+}diff --git a/installer/versions/1.2.6/partitions.bin b/installer/versions/1.2.6/partitions.binnew file mode 100644index 0000000..1954582Binary files /dev/null and b/installer/versions/1.2.6/partitions.bin differdiff --git a/scripts/publish-firmware.mjs b/scripts/publish-firmware.mjsindex 4dbe1bc..a3760a2 100644--- a/scripts/publish-firmware.mjs+++ b/scripts/publish-firmware.mjs@@ -32,7 +32,7 @@ const manifestPaths = [const releasesPath = join(projectDirectory, "installer", "releases.json");const releaseNotesPath = join(projectDirectory, "installer", "release-notes.json");const versionsDirectory = join(projectDirectory, "installer", "versions");-const retainedReleaseCount = 5;+const retainedReleaseCount = 10;const versionPattern = /^\d+\.\d+\.\d+$/;function displayPath(path) {diff --git a/src/SHCustomProtocol.h b/src/SHCustomProtocol.hindex 47f11fc..edbf6ea 100644--- a/src/SHCustomProtocol.h+++ b/src/SHCustomProtocol.h@@ -1563,22 +1563,27 @@ public:void drawRpmMeterGT3(bool forceUpdate){- const int segmentCount = DashboardLayout::RPM_SEGMENTS;+ const int segmentCount = 36;+ const int barLeft = 12;+ const int barRight = DashboardLayout::WIDTH - barLeft;+ const int segmentPitch = 8;const int active = constrain((rpmPercent * segmentCount + 99) / 100, 0, segmentCount);const int previous = forceUpdate ? -1 : constrain((prev_rpmPercent * segmentCount + 99) / 100, 0, segmentCount);const bool redlineChanged = prevData["gt3Redline"] != String(rpmRedLineSetting);if (!forceUpdate && active == previous && !redlineChanged) return;- const int gradientStops[] = {0, 11, 20, 26, 31};+ const int gradientStops[] = {0, 12, 17, 21, 24, 27, 35};const uint8_t gradientRgb[][3] = {- {86, 90, 96}, {245, 245, 245}, {255, 220, 0},- {255, 118, 0}, {255, 20, 28}};+ {0, 112, 255}, {0, 218, 255}, {35, 232, 118},+ {255, 220, 0}, {255, 112, 0}, {255, 20, 28},+ {255, 20, 28}};+ const uint16_t inactiveColor = tft.color565(0x20, 0x28, 0x2C);for (int i = 0; i < segmentCount; ++i){if (!forceUpdate && !redlineChanged && i < min(active, previous)) continue;if (!forceUpdate && !redlineChanged && i >= max(active, previous)) continue;int stop = 0;- while (stop < 3 && i > gradientStops[stop + 1]) ++stop;+ while (stop < 5 && i > gradientStops[stop + 1]) ++stop;const int span = gradientStops[stop + 1] - gradientStops[stop];const int offset = constrain(i - gradientStops[stop], 0, span);int red = gradientRgb[stop][0] +@@ -1587,24 +1592,19 @@ public:(gradientRgb[stop + 1][1] - gradientRgb[stop][1]) * offset / span;int blue = gradientRgb[stop][2] +(gradientRgb[stop + 1][2] - gradientRgb[stop][2]) * offset / span;- if (i >= active)- {- red /= 4;- green /= 4;- blue /= 4;- }- const uint16_t color = tft.color565(red, green, blue);- // A shallow parabola gives an inexpensive GT-style arc. Each segment is- // a four-point strip made from two filled triangles, with a 3 px gap.- const int x0 = DashboardLayout::RPM_SEGMENT_X + i * DashboardLayout::RPM_SEGMENT_PITCH;- const int x1 = x0 + DashboardLayout::RPM_SEGMENT_W;- const int dx0 = x0 - DashboardLayout::CENTER_X;- const int dx1 = x1 - DashboardLayout::CENTER_X;- const int y0 = 11 + (dx0 * dx0) / 1000;- const int y1 = 11 + (dx1 * dx1) / 1000;- const int thickness = DashboardLayout::RPM_SEGMENT_THICKNESS;- tft.fillTriangle(x0, y0, x1, y1, x0, y0 + thickness, color);- tft.fillTriangle(x1, y1, x1, y1 + thickness, x0, y0 + thickness, color);+ const uint16_t color = i < active+ ? tft.color565(red, green, blue)+ : inactiveColor;+ // Test geometry: every segment is the same unrotated rectangle. Only its+ // centre follows the existing gentle symmetric parabola.+ const int segmentCenterX = DashboardLayout::CENTER_X ++ (2 * i - (segmentCount - 1)) * segmentPitch / 2;+ const int dx = segmentCenterX - DashboardLayout::CENTER_X;+ const int segmentY = 15 + (dx * dx) / 1800;+ const int segmentWidth = 6;+ const int thickness = 18;+ tft.fillRect(segmentCenterX - segmentWidth / 2, segmentY,+ segmentWidth, thickness, color);}if (forceUpdate){@@ -1612,17 +1612,17 @@ public:const char *labels[] = {"0", "2", "4", "6", "8", "10"};for (int i = 0; i < 6; ++i){- const int labelX = DashboardLayout::RPM_LABEL_LEFT_X +- (DashboardLayout::RPM_LABEL_RIGHT_X - DashboardLayout::RPM_LABEL_LEFT_X) * i / 5;+ const int labelX = barLeft + 4 ++ (barRight - barLeft - 8) * i / 5;const int dx = labelX - DashboardLayout::CENTER_X;- const int labelY = 1 + (dx * dx) / 1100;+ const int labelY = 3 + (dx * dx) / 1700;drawMeasuredText(labels[i], labelX - 10, labelY, 20, 10,- &fonts::FreeSans9pt7b, rpmTextColor, MC_DATUM, 0.54f, 0.52f);+ &fonts::FreeSans9pt7b, rpmTextColor, MC_DATUM, 0.52f, 0.50f);}// Dedicated center caption band below the arc; it cannot overlap ticks.- drawMeasuredText("RPM x1000", DashboardLayout::CENTER_X - 55, 28, 110, 18,- &fonts::FreeSans9pt7b, rpmTextColor, MC_DATUM, 0.74f, 0.72f);+ drawMeasuredText("RPM x1000", DashboardLayout::CENTER_X - 55, 40, 110, 10,+ &fonts::FreeSans9pt7b, rpmTextColor, MC_DATUM, 0.52f, 0.50f);}prev_rpmPercent = rpmPercent;prevData["gt3Redline"] = String(rpmRedLineSetting);