Skip to content
C

support st7789

YU CHIH CHANGf80c5dd3609d
diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml
index 4f739aa..ff4f6f3 100644
--- a/.github/workflows/deploy-pages.yml
+++ b/.github/workflows/deploy-pages.yml
@@ -35,7 +35,7 @@ jobs:
shell: bash
run: |
node <<'NODE'
- const { readFile, stat } = require("node:fs/promises");
+ const { readFile, readdir, stat } = require("node:fs/promises");
const { isAbsolute, relative, resolve, sep } = require("node:path");
const installerRoot = resolve("installer");
@@ -82,29 +82,45 @@ jobs:
await requireNonEmptyFile(indexPath, "Installer index");
await requireNonEmptyFile(manifestPath, "Installer manifest");
- let manifest;
- try {
- manifest = JSON.parse(await readFile(manifestPath, "utf8"));
- } catch (error) {
- throw new Error(`Unable to parse installer/manifest.json: ${error.message}`);
- }
+ const manifestNames = (await readdir(installerRoot)).filter((name) =>
+ /^manifest(?:-[a-z0-9-]+)?\.json$/i.test(name),
+ );
+ let binaryCount = 0;
- const parts = Array.isArray(manifest.builds)
- ? manifest.builds.flatMap((build) =>
- Array.isArray(build?.parts) ? build.parts : [],
- )
- : [];
+ for (const manifestName of manifestNames) {
+ const currentManifestPath = resolve(installerRoot, manifestName);
+ await requireNonEmptyFile(currentManifestPath, `Installer manifest "${manifestName}"`);
- if (parts.length === 0) {
- throw new Error("installer/manifest.json does not reference any binaries.");
- }
+ let manifest;
+ try {
+ manifest = JSON.parse(await readFile(currentManifestPath, "utf8"));
+ } catch (error) {
+ throw new Error(`Unable to parse installer/${manifestName}: ${error.message}`);
+ }
- for (const part of parts) {
- const binaryPath = installerPath(part?.path);
- await requireNonEmptyFile(binaryPath, `Manifest binary "${part.path}"`);
+ const parts = Array.isArray(manifest.builds)
+ ? manifest.builds.flatMap((build) =>
+ Array.isArray(build?.parts) ? build.parts : [],
+ )
+ : [];
+
+ if (parts.length === 0) {
+ throw new Error(`installer/${manifestName} does not reference any binaries.`);
+ }
+
+ for (const part of parts) {
+ const binaryPath = installerPath(part?.path);
+ await requireNonEmptyFile(
+ binaryPath,
+ `${manifestName} binary "${part.path}"`,
+ );
+ binaryCount += 1;
+ }
}
- console.log(`Validated installer and ${parts.length} manifest-referenced binaries.`);
+ console.log(
+ `Validated installer, ${manifestNames.length} manifests, and ${binaryCount} binary references.`,
+ );
}
main().catch((error) => {
diff --git a/README.md b/README.md
index 06b09dd..96adf95 100644
--- a/README.md
+++ b/README.md
@@ -54,9 +54,12 @@ Simply connect your ESP32 to the same Wi-Fi network as your PS5 and enjoy real-t
Currently supported:
-- ESP32-2432S028 (2.8" ILI9341 Touch Display)
+- ESP32-2432S028 with 2.8" ILI9341 touch display
+- ESP32-2432S028 with 2.8" ST7789 touch display
-Additional ESP32 displays may be supported in future releases.
+<p align="center">
+ <img src="photos/001.jpg" width="900" alt="ESP32 GT7 Dashboard">
+</p>
---
@@ -68,9 +71,10 @@ No development tools are required.
1. Connect your ESP32 to your computer using USB.
2. Open the Web Installer.
-3. Click **Install**.
-4. Wait for the installation to complete.
-5. Disconnect the USB cable and power the device.
+3. Select the display controller fitted to the board: **ILI9341** or **ST7789**.
+4. Click **Install**.
+5. Wait for the installation to complete.
+6. Disconnect the USB cable and power the device.
👉 **https://caa1211.github.io/esp32-gt7-dashboard/**
@@ -173,14 +177,28 @@ This project is built using:
- Arduino Framework
- ESP32
-Clone the repository and build with PlatformIO.
+Clone the repository, then build both display-controller variants with PlatformIO:
```bash
git clone https://github.com/caa1211/esp32-gt7-dashboard.git
cd esp32-gt7-dashboard
-pio run
+pio run -e esp32 -e esp32-st7789
+```
+
+The application images are generated at:
+
+- `.pio/build/esp32/firmware.bin` — ILI9341
+- `.pio/build/esp32-st7789/firmware.bin` — ST7789
+
+For a release build that also synchronizes the version, copies both images into
+`installer/firmware/`, and validates both installer manifests, run:
+
+```bash
+npm run publish:firmware -- 1.2.5
```
+Replace `1.2.5` with the version being released.
+
---
## Contributing
diff --git a/README.zh-TW.md b/README.zh-TW.md
index e161276..b339b87 100644
--- a/README.zh-TW.md
+++ b/README.zh-TW.md
@@ -56,8 +56,11 @@
目前支援:
- ESP32-2432S028(2.8 吋 ILI9341 觸控螢幕)
+- ESP32-2432S028(2.8 吋 ST7789 觸控螢幕)
-未來將陸續支援更多 ESP32 顯示器。
+<p align="left">
+ <img src="photos/esp32.jpg" width="400" alt="ESP32-2432S028">
+</p>
---
@@ -69,9 +72,10 @@
1. 使用 USB 將 ESP32 連接到電腦。
2. 開啟 Web Installer。
-3. 點擊 **Install**。
-4. 等待安裝完成。
-5. 拔除 USB 並重新上電。
+3. 選擇板子使用的顯示控制器:**ILI9341** 或 **ST7789**。
+4. 點擊 **Install**。
+5. 等待安裝完成。
+6. 拔除 USB 並重新上電。
👉 **https://caa1211.github.io/esp32-gt7-dashboard/**
@@ -169,14 +173,28 @@ http://192.168.4.1
- Arduino Framework
- ESP32
-下載原始碼後使用 PlatformIO 編譯:
+下載原始碼後,使用 PlatformIO 同時編譯兩種顯示控制器版本:
```bash
git clone https://github.com/caa1211/esp32-gt7-dashboard.git
cd esp32-gt7-dashboard
-pio run
+pio run -e esp32 -e esp32-st7789
+```
+
+產生的 application image 位於:
+
+- `.pio/build/esp32/firmware.bin` — ILI9341
+- `.pio/build/esp32-st7789/firmware.bin` — ST7789
+
+若要建立正式發佈版本,同時同步版本號、複製兩份 image 到
+`installer/firmware/`,並驗證兩份 installer manifest,請執行:
+
+```bash
+npm run publish:firmware -- 1.2.5
```
+請將 `1.2.5` 替換成這次要發佈的版本號。
+
---
## 貢獻
diff --git a/docs/RELEASING.md b/docs/RELEASING.md
index fc50a0a..0e865e9 100644
--- a/docs/RELEASING.md
+++ b/docs/RELEASING.md
@@ -5,11 +5,11 @@ PlatformIO and does not compile the firmware. Build and test every release local
committing its binary images.
`VERSION` is the only manually controlled version source. The publish helper synchronizes
-that value into the generated C++ header and ESP Web Tools manifest.
+that value into the generated C++ header and both ESP Web Tools manifests.
## Flash layout
-The project uses the `esp32` PlatformIO environment, the classic
+The project uses the `esp32` and `esp32-st7789` PlatformIO environments, the classic
`esp32doit-devkit-v1` board, Arduino framework, and `huge_app.csv` partition table.
PlatformIO's resolved upload metadata defines this flash layout:
@@ -18,7 +18,8 @@ PlatformIO's resolved upload metadata defines this flash layout:
| `0x1000` | `installer/firmware/bootloader.bin` | `.pio/build/esp32/bootloader.bin` |
| `0x8000` | `installer/firmware/partitions.bin` | `.pio/build/esp32/partitions.bin` |
| `0xE000` | `installer/firmware/boot_app0.bin` | PlatformIO's Arduino ESP32 package, `tools/partitions/boot_app0.bin` |
-| `0x10000` | `installer/firmware/firmware.bin` | `.pio/build/esp32/firmware.bin` |
+| `0x10000` | `installer/firmware/firmware-ili9341.bin` | `.pio/build/esp32/firmware.bin` |
+| `0x10000` | `installer/firmware/firmware-st7789.bin` | `.pio/build/esp32-st7789/firmware.bin` |
These offsets are not arbitrary: the ESP32 PlatformIO integration places the bootloader at
`0x1000`, the partition table at `0x8000`, the OTA data initializer at `0xE000`, and the
@@ -27,7 +28,7 @@ starts at `0xE000` and the first application partition starts at `0x10000`.
Re-check PlatformIO's verbose upload command or resolved project metadata if the board,
framework platform, or partition table changes. Update both this document and
-`installer/manifest.json` if the flash map changes.
+`installer/manifest.json` and `installer/manifest-st7789.json` if the flash map changes.
## Build and test locally
@@ -39,10 +40,11 @@ framework platform, or partition table changes. Update both this document and
node scripts/publish-firmware.mjs 1.2.3
```
- The script validates the version, updates `VERSION`, `include/version.h`, and
- `installer/manifest.json`, then runs `pio run -e esp32`. After a successful build it
- validates and copies all four non-empty binaries into `installer/firmware/`, verifies
- every manifest binary, and prints sizes, SHA-256 hashes, and a release summary.
+ The script validates the version; updates `VERSION`, `include/version.h`, and both
+ installer manifests; then builds the `esp32` ILI9341 and `esp32-st7789` environments.
+ After successful builds it validates and copies the three shared boot files plus both
+ application images into `installer/firmware/`, verifies every manifest binary, and
+ prints sizes, SHA-256 hashes, and a release summary.
Running the command without a version preserves the existing behavior by reading the
current value from `VERSION`:
@@ -77,25 +79,26 @@ framework platform, or partition table changes. Update both this document and
## Stage the installer binaries
-Create `installer/firmware/` if necessary, then copy the four real binary files listed in
-the flash-layout table into it. The first, second, and fourth files come from
-`.pio/build/esp32/`. Locate `boot_app0.bin` in the installed Arduino ESP32 framework package
-reported by PlatformIO; on typical systems it is under:
+Create `installer/firmware/` if necessary, then copy the five real binary files listed in
+the flash-layout table into it. The two application images come from their respective
+PlatformIO environment build directories. Locate `boot_app0.bin` in the installed Arduino
+ESP32 framework package reported by PlatformIO; on typical systems it is under:
```text
<PlatformIO home>/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin
```
Do not commit `.pio/`. Do not add empty or placeholder binary files. Before committing,
-verify that all four installer binaries exist and have non-zero sizes:
+verify that all five installer binaries exist and have non-zero sizes:
```bash
git status --short
-git check-ignore -v installer/firmware/firmware.bin
+git check-ignore -v installer/firmware/firmware-ili9341.bin
+git check-ignore -v installer/firmware/firmware-st7789.bin
```
-The second command should produce no output. Review the files that will be committed, then
-commit the four binaries together with any intentional manifest version change.
+The `git check-ignore` commands should produce no output. Review the files that will be
+committed, then commit the five binaries together with both manifest version changes.
## Verify the installer
@@ -104,11 +107,12 @@ commit the four binaries together with any intentional manifest version change.
HTTPS Pages site is the most representative test.
2. Open the installer in Chrome, Edge, or another desktop browser with Web Serial support.
3. Connect a test ESP32 using a data-capable USB cable and close any serial monitor.
-4. Select **Install firmware**, choose the correct serial port, and complete the flash.
+4. Select the correct display controller, select **Install firmware**, choose the correct
+ serial port, and complete the flash.
5. Power-cycle the device and repeat the functional checks above.
6. In repository **Settings > Pages**, ensure the source is set to **GitHub Actions**. Confirm
- that the deployment succeeded and that the public installer loads its manifest and all
- four binary URLs without 404 errors.
+ that the deployment succeeded and that the public installer loads both manifests and all
+ five binary URLs without 404 errors.
The Pages workflow is intentionally path-filtered and uploads only `installer/`; source code,
documentation, `.pio/`, and local build tooling are not included in the published artifact.
diff --git a/installer/firmware/firmware-ili9341.bin b/installer/firmware/firmware-ili9341.bin
new file mode 100644
index 0000000..f0ca128
Binary files /dev/null and b/installer/firmware/firmware-ili9341.bin differ
diff --git a/installer/firmware/firmware-st7789.bin b/installer/firmware/firmware-st7789.bin
new file mode 100644
index 0000000..0bd5bce
Binary files /dev/null and b/installer/firmware/firmware-st7789.bin differ
diff --git a/installer/index.html b/installer/index.html
index 42b7ff7..5271e5a 100644
--- a/installer/index.html
+++ b/installer/index.html
@@ -175,6 +175,38 @@
padding: 8px 0 16px;
}
+ .firmware-choice {
+ margin: 0 auto 14px;
+ max-width: 360px;
+ }
+
+ .firmware-choice label {
+ display: block;
+ margin-bottom: 7px;
+ color: #d8e2ef;
+ font-size: 0.9rem;
+ font-weight: 700;
+ text-align: center;
+ }
+
+ .firmware-choice select {
+ width: 100%;
+ padding: 11px 36px 11px 13px;
+ border: 1px solid rgba(56, 189, 248, 0.35);
+ border-radius: 10px;
+ background: #172033;
+ color: #f8fafc;
+ font: inherit;
+ }
+
+ .firmware-choice p {
+ margin: 7px 0 0;
+ color: #8fa3bb;
+ font-size: 0.78rem;
+ line-height: 1.45;
+ text-align: center;
+ }
+
.connect-button {
width: 280px;
max-width: 100%;
@@ -327,8 +359,17 @@
<li>Leave the board connected until the installation finishes.</li>
</ol>
+ <div class="firmware-choice">
+ <label for="display-controller">Display controller</label>
+ <select id="display-controller">
+ <option value="manifest.json">ILI9341 (standard)</option>
+ <option value="manifest-st7789.json">ST7789 (alternate)</option>
+ </select>
+ <p>Select the controller fitted to your ESP32-2432S028.</p>
+ </div>
+
<div class="install">
- <esp-web-install-button manifest="manifest.json">
+ <esp-web-install-button id="install-button" manifest="manifest.json">
<button class="connect-button" slot="activate">Connect &amp; install</button>
<button slot="unsupported">Use Chrome, Edge, or another Web Serial browser</button>
</esp-web-install-button>
@@ -368,17 +409,31 @@
</main>
<script>
- fetch("manifest.json", { cache: "no-store" })
- .then((response) => {
- if (!response.ok) throw new Error(`HTTP ${response.status}`);
- return response.json();
- })
- .then((manifest) => {
- document.getElementById("release-version").textContent = `Version ${manifest.version}`;
- })
- .catch(() => {
- document.getElementById("release-version").textContent = "Version unavailable";
- });
+ const controllerSelect = document.getElementById("display-controller");
+ const installButton = document.getElementById("install-button");
+ const versionLabel = document.getElementById("release-version");
+
+ function selectManifest(manifestPath) {
+ installButton.setAttribute("manifest", manifestPath);
+
+ fetch(manifestPath, { cache: "no-store" })
+ .then((response) => {
+ if (!response.ok) throw new Error(`HTTP ${response.status}`);
+ return response.json();
+ })
+ .then((manifest) => {
+ versionLabel.textContent = `Version ${manifest.version}`;
+ })
+ .catch(() => {
+ versionLabel.textContent = "Version unavailable";
+ });
+ }
+
+ controllerSelect.addEventListener("change", () => {
+ selectManifest(controllerSelect.value);
+ });
+
+ selectManifest(controllerSelect.value);
</script>
</body>
</html>
diff --git a/installer/manifest-st7789.json b/installer/manifest-st7789.json
new file mode 100644
index 0000000..a667d85
--- /dev/null
+++ b/installer/manifest-st7789.json
@@ -0,0 +1,28 @@
+{
+ "name": "ESP32 GT7 Dashboard (ST7789)",
+ "version": "1.2.4",
+ "new_install_prompt_erase": true,
+ "builds": [
+ {
+ "chipFamily": "ESP32",
+ "parts": [
+ {
+ "path": "firmware/bootloader.bin",
+ "offset": 4096
+ },
+ {
+ "path": "firmware/partitions.bin",
+ "offset": 32768
+ },
+ {
+ "path": "firmware/boot_app0.bin",
+ "offset": 57344
+ },
+ {
+ "path": "firmware/firmware-st7789.bin",
+ "offset": 65536
+ }
+ ]
+ }
+ ]
+}
diff --git a/installer/manifest.json b/installer/manifest.json
index 17647d2..2d9160f 100644
--- a/installer/manifest.json
+++ b/installer/manifest.json
@@ -1,5 +1,5 @@
{
- "name": "ESP32 GT7 Dashboard",
+ "name": "ESP32 GT7 Dashboard (ILI9341)",
"version": "1.2.4",
"new_install_prompt_erase": true,
"builds": [
@@ -19,7 +19,7 @@
"offset": 57344
},
{
- "path": "firmware/firmware.bin",
+ "path": "firmware/firmware-ili9341.bin",
"offset": 65536
}
]
diff --git a/photos/esp32.jpg b/photos/esp32.jpg
new file mode 100644
index 0000000..01ce14f
Binary files /dev/null and b/photos/esp32.jpg differ
diff --git a/photos/esp32.png b/photos/esp32.png
new file mode 100644
index 0000000..377d205
Binary files /dev/null and b/photos/esp32.png differ
diff --git a/platformio.ini b/platformio.ini
index 9999be6..b220eb5 100644
--- a/platformio.ini
+++ b/platformio.ini
@@ -100,6 +100,14 @@ build_flags =
;upload_speed = 921600
;upload_port = COM10
-upload_port = COM3
-monitor_port = COM3
-monitor_speed = 115200
\ No newline at end of file
+upload_port = COM4
+monitor_port = COM4
+monitor_speed = 115200
+
+# Alternate ESP32-2432S028 display controller.
+# The default esp32 environment keeps the original ILI9341 panel configuration.
+[env:esp32-st7789]
+extends = env:esp32
+build_flags =
+ ${env:esp32.build_flags}
+ -DDISPLAY_PANEL_ST7789=1
diff --git a/scripts/publish-firmware.mjs b/scripts/publish-firmware.mjs
index 0bda70f..5f64645 100644
--- a/scripts/publish-firmware.mjs
+++ b/scripts/publish-firmware.mjs
@@ -3,18 +3,32 @@
import { createHash } from "node:crypto";
import { copyFile, mkdir, readFile, stat, writeFile } from "node:fs/promises";
import { homedir } from "node:os";
-import { basename, dirname, join, relative, resolve } from "node:path";
+import { dirname, join, relative, resolve } from "node:path";
import { spawnSync } from "node:child_process";
import { fileURLToPath } from "node:url";
const scriptDirectory = dirname(fileURLToPath(import.meta.url));
const projectDirectory = resolve(scriptDirectory, "..");
-const environment = process.env.PLATFORMIO_ENV ?? "esp32";
-const buildDirectory = join(projectDirectory, ".pio", "build", environment);
+const variants = [
+ {
+ id: "ili9341",
+ environment: process.env.PLATFORMIO_ENV ?? "esp32",
+ firmwareName: "firmware-ili9341.bin",
+ },
+ {
+ id: "st7789",
+ environment: process.env.PLATFORMIO_ST7789_ENV ?? "esp32-st7789",
+ firmwareName: "firmware-st7789.bin",
+ },
+];
const firmwareDirectory = join(projectDirectory, "installer", "firmware");
const versionPath = join(projectDirectory, "VERSION");
const versionHeaderPath = join(projectDirectory, "include", "version.h");
const manifestPath = join(projectDirectory, "installer", "manifest.json");
+const manifestPaths = [
+ manifestPath,
+ join(projectDirectory, "installer", "manifest-st7789.json"),
+];
const versionPattern = /^\d+\.\d+\.\d+$/;
function displayPath(path) {
@@ -66,8 +80,6 @@ async function resolveVersion(suppliedVersion) {
async function synchronizeVersion(version) {
const modifiedFiles = [];
- const manifest = JSON.parse(await readFile(manifestPath, "utf8"));
- manifest.version = version;
await writeIfChanged(versionPath, `${version}\n`, modifiedFiles);
await writeIfChanged(
@@ -75,7 +87,16 @@ async function synchronizeVersion(version) {
`#pragma once\n\ninline constexpr char GT7_DASH_VERSION[] = "${version}";\n`,
modifiedFiles,
);
- await writeIfChanged(manifestPath, `${JSON.stringify(manifest, null, 2)}\n`, modifiedFiles);
+
+ for (const currentManifestPath of manifestPaths) {
+ const manifest = JSON.parse(await readFile(currentManifestPath, "utf8"));
+ manifest.version = version;
+ await writeIfChanged(
+ currentManifestPath,
+ `${JSON.stringify(manifest, null, 2)}\n`,
+ modifiedFiles,
+ );
+ }
return modifiedFiles;
}
@@ -84,13 +105,20 @@ async function verifySynchronizedVersion(expectedVersion) {
const version = (await readFile(versionPath, "utf8")).trim();
const header = await readFile(versionHeaderPath, "utf8");
const headerMatch = header.match(/inline constexpr char GT7_DASH_VERSION\[\] = "(\d+\.\d+\.\d+)";/);
- const manifest = JSON.parse(await readFile(manifestPath, "utf8"));
+ const manifests = [];
+ for (const currentManifestPath of manifestPaths) {
+ const manifest = JSON.parse(await readFile(currentManifestPath, "utf8"));
+ if (manifest.version !== version) {
+ throw new Error(`Version verification failed for ${displayPath(currentManifestPath)}.`);
+ }
+ manifests.push({ path: currentManifestPath, manifest });
+ }
- if (version !== expectedVersion || headerMatch?.[1] !== version || manifest.version !== version) {
- throw new Error("Version verification failed for VERSION, include/version.h, or installer/manifest.json.");
+ if (version !== expectedVersion || headerMatch?.[1] !== version) {
+ throw new Error("Version verification failed for VERSION or include/version.h.");
}
- return manifest;
+ return manifests;
}
function platformioCandidates() {
@@ -117,7 +145,7 @@ function platformioCandidates() {
return [...new Set(candidates)];
}
-function runBuild() {
+function runBuild(environment) {
for (const command of platformioCandidates()) {
const result = spawnSync(command, ["run", "-e", environment], {
cwd: projectDirectory,
@@ -176,67 +204,88 @@ async function sha256(path) {
return createHash("sha256").update(contents).digest("hex");
}
-async function verifyManifestBinaries(manifest) {
- const parts = manifest.builds?.flatMap((build) => build.parts ?? []) ?? [];
+async function verifyManifestBinaries(manifests) {
+ for (const { path: currentManifestPath, manifest } of manifests) {
+ const parts = manifest.builds?.flatMap((build) => build.parts ?? []) ?? [];
- if (parts.length === 0) {
- throw new Error("The installer manifest does not reference any binary files.");
- }
+ if (parts.length === 0) {
+ throw new Error(`${displayPath(currentManifestPath)} does not reference any binary files.`);
+ }
- for (const part of parts) {
- const binaryPath = resolve(dirname(manifestPath), part.path);
- await verifyNonEmpty(binaryPath);
+ for (const part of parts) {
+ const binaryPath = resolve(dirname(currentManifestPath), part.path);
+ await verifyNonEmpty(binaryPath);
+ }
}
}
function printSummary({ version, skipBuild, copiedFiles, modifiedFiles }) {
console.log("\nRelease summary");
console.log(` Version: ${version}`);
- console.log(` PlatformIO environment: ${environment}`);
- console.log(` Build output: ${displayPath(buildDirectory)}`);
- console.log(` Manifest: ${displayPath(manifestPath)}`);
+ console.log(` PlatformIO environments: ${variants.map((variant) => variant.environment).join(", ")}`);
+ console.log(` Manifests: ${manifestPaths.map(displayPath).join(", ")}`);
console.log(` Build: ${skipBuild ? "skipped" : "successful"}`);
console.log(` Copied binaries: ${copiedFiles.length ? copiedFiles.join(", ") : "none (--skip-build)"}`);
console.log(` Modified files: ${modifiedFiles.length ? modifiedFiles.join(", ") : "none"}`);
}
+async function copyVerifiedBinary(source, destinationName, copiedFiles) {
+ await verifyNonEmpty(source);
+ const destination = join(firmwareDirectory, destinationName);
+ await copyFile(source, destination);
+ const size = await verifyNonEmpty(destination);
+ copiedFiles.push(displayPath(destination));
+ console.log(`${destinationName}: ${size} bytes, SHA-256 ${await sha256(destination)}`);
+}
+
async function main() {
const { suppliedVersion, skipBuild } = parseArguments();
const version = await resolveVersion(suppliedVersion);
const modifiedFiles = await synchronizeVersion(version);
- let manifest = await verifySynchronizedVersion(version);
+ let manifests = await verifySynchronizedVersion(version);
if (skipBuild) {
printSummary({ version, skipBuild, copiedFiles: [], modifiedFiles });
return;
}
- console.log(`Building PlatformIO environment: ${environment}`);
- const command = runBuild();
- console.log(`Build completed with: ${command}`);
-
- const binaries = [
- join(buildDirectory, "bootloader.bin"),
- join(buildDirectory, "partitions.bin"),
- frameworkBootAppPath(),
- join(buildDirectory, "firmware.bin"),
- ];
+ for (const variant of variants) {
+ console.log(`Building ${variant.id} with PlatformIO environment: ${variant.environment}`);
+ const command = runBuild(variant.environment);
+ console.log(`Build completed with: ${command}`);
+ }
await mkdir(firmwareDirectory, { recursive: true });
const copiedFiles = [];
console.log(`Copying firmware to: ${firmwareDirectory}`);
- for (const source of binaries) {
- await verifyNonEmpty(source);
- const destination = join(firmwareDirectory, basename(source));
- await copyFile(source, destination);
- const size = await verifyNonEmpty(destination);
- copiedFiles.push(displayPath(destination));
- console.log(`${basename(destination)}: ${size} bytes, SHA-256 ${await sha256(destination)}`);
+
+ const standardBuildDirectory = join(
+ projectDirectory,
+ ".pio",
+ "build",
+ variants[0].environment,
+ );
+ for (const sharedBinary of ["bootloader.bin", "partitions.bin"]) {
+ await copyVerifiedBinary(
+ join(standardBuildDirectory, sharedBinary),
+ sharedBinary,
+ copiedFiles,
+ );
+ }
+ await copyVerifiedBinary(frameworkBootAppPath(), "boot_app0.bin", copiedFiles);
+
+ for (const variant of variants) {
+ const buildDirectory = join(projectDirectory, ".pio", "build", variant.environment);
+ await copyVerifiedBinary(
+ join(buildDirectory, "firmware.bin"),
+ variant.firmwareName,
+ copiedFiles,
+ );
}
- manifest = await verifySynchronizedVersion(version);
- await verifyManifestBinaries(manifest);
+ manifests = await verifySynchronizedVersion(version);
+ await verifyManifestBinaries(manifests);
printSummary({ version, skipBuild, copiedFiles, modifiedFiles });
}
diff --git a/src/SHCustomProtocol.h b/src/SHCustomProtocol.h
index 15f8cd0..e55aaf4 100644
--- a/src/SHCustomProtocol.h
+++ b/src/SHCustomProtocol.h
@@ -292,7 +292,7 @@ public:
void setup()
{
tft.init();
- tft.setRotation(3);
+ tft.setRotation(DASHBOARD_DISPLAY_ROTATION);
tft.setBrightness(SCREEN_NORMAL_BRIGHTNESS);
currentBrightness = SCREEN_NORMAL_BRIGHTNESS;
tft.fillScreen(TFT_BLACK);
diff --git a/src/lgfx_user/LGFX_ESP32_esp32-2432s028.hpp b/src/lgfx_user/LGFX_ESP32_esp32-2432s028.hpp
index f19d87a..b08614c 100644
--- a/src/lgfx_user/LGFX_ESP32_esp32-2432s028.hpp
+++ b/src/lgfx_user/LGFX_ESP32_esp32-2432s028.hpp
@@ -20,8 +20,20 @@ Se vuoi operare in sicurezza, crea un backup o inseriscilo nella cartella del pr
// https://github.com/lovyan03/LovyanGFX/blob/master/examples/HowToUse/2_user_setting/2_user_setting.ino
+#if defined(DISPLAY_PANEL_ST7789)
+static constexpr uint8_t DASHBOARD_DISPLAY_ROTATION = 1;
+static constexpr uint8_t DASHBOARD_TOUCH_ROTATION_OFFSET = 4;
+#else
+static constexpr uint8_t DASHBOARD_DISPLAY_ROTATION = 3;
+static constexpr uint8_t DASHBOARD_TOUCH_ROTATION_OFFSET = 6;
+#endif
+
class LGFX : public lgfx::LGFX_Device{
+#if defined(DISPLAY_PANEL_ST7789)
+ lgfx::Panel_ST7789 _panel_instance;
+#else
lgfx::Panel_ILI9341 _panel_instance;
+#endif
lgfx::Bus_SPI _bus_instance;
lgfx::Light_PWM _light_instance;
lgfx::Touch_XPT2046 _touch_instance;
@@ -85,7 +97,7 @@ public:LGFX(void){
cfg.y_max = 3700; // Valore Y massimo ottenuto dal touch screen (valore grezzo)
cfg.pin_int = -1; // Numero pin a cui è collegato INT, TP IRQ 36
cfg.bus_shared = false; // Imposta true se si utilizza lo stesso bus dello schermo
- cfg.offset_rotation = 6; // Regolazione quando la direzione del display e del tocco non corrispondono Impostare con un valore compreso tra 0 e 7
+ cfg.offset_rotation = DASHBOARD_TOUCH_ROTATION_OFFSET; // Regolazione quando la direzione del display e del tocco non corrispondono Impostare con un valore compreso tra 0 e 7
// Per la connessione SPI
cfg.spi_host = VSPI_HOST;// 使Seleziona la SPI da utilizzare (HSPI_HOST o VSPI_HOST)
cfg.freq = 1000000; // Seleziona la SPI da utilizzare (HSPI_HOST o VSPI_HOST)