diff --git a/data/waveshare13e6-v1/ap_bg.bin b/data/waveshare13e6-v1/ap_bg.bin index d86001d..8426010 100644 Binary files a/data/waveshare13e6-v1/ap_bg.bin and b/data/waveshare13e6-v1/ap_bg.bin differ diff --git a/data/waveshare13e6-v1/ap_bg_preview.png b/data/waveshare13e6-v1/ap_bg_preview.png index 09670f7..f80bb4c 100644 Binary files a/data/waveshare13e6-v1/ap_bg_preview.png and b/data/waveshare13e6-v1/ap_bg_preview.png differ diff --git a/data/waveshare13e6-v1/ap_bg_retry.bin b/data/waveshare13e6-v1/ap_bg_retry.bin index 20ed18c..30a7f02 100644 Binary files a/data/waveshare13e6-v1/ap_bg_retry.bin and b/data/waveshare13e6-v1/ap_bg_retry.bin differ diff --git a/data/waveshare13e6-v1/ap_bg_retry_preview.png b/data/waveshare13e6-v1/ap_bg_retry_preview.png index 655d35f..2c2699d 100644 Binary files a/data/waveshare13e6-v1/ap_bg_retry_preview.png and b/data/waveshare13e6-v1/ap_bg_retry_preview.png differ diff --git a/data/waveshare13e6-v1/setup_bg.bin b/data/waveshare13e6-v1/setup_bg.bin index 0b2ba27..cb48d04 100644 Binary files a/data/waveshare13e6-v1/setup_bg.bin and b/data/waveshare13e6-v1/setup_bg.bin differ diff --git a/data/waveshare13e6-v1/setup_bg_preview.png b/data/waveshare13e6-v1/setup_bg_preview.png index 6dee72c..b97ba77 100644 Binary files a/data/waveshare13e6-v1/setup_bg_preview.png and b/data/waveshare13e6-v1/setup_bg_preview.png differ diff --git a/scripts/gen_screens_13e6.py b/scripts/gen_screens_13e6.py index fb68c16..4f54b7e 100644 --- a/scripts/gen_screens_13e6.py +++ b/scripts/gen_screens_13e6.py @@ -564,6 +564,12 @@ def gen_setup(): # ── Save ───────────────────────────────────────────────────────────────────── def save_bin(img, path, preview_path): + # Physical mount compensation: 13.3" panel ships ribbon-at-bottom of + # portrait, opposite the scan-zero corner. Rotate 180° before packing + # so the .bin's scan order maps to a right-side-up image on the panel. + # Server-side render does the same — see DeviceModel::physicalRotationDegrees(). + img = img.rotate(180) + data = pack(img) with open(path, "wb") as f: f.write(data) @@ -593,7 +599,11 @@ if __name__ == "__main__": print("Generating setup screen…") save_bin(gen_setup(), f"{out_dir}/setup_bg.bin", f"{out_dir}/setup_bg_preview.png") print() - print("QR overlay constants — keep these in sync with epd_driver.cpp:") - print(f" AP_QR_X={AP_QR_X}, AP_QR_Y={AP_QR_Y}, AP_QR_CELL={AP_QR_CELL}, AP_QR_PX={AP_QR_PX}") - print(f" SETUP_QR_X={SETUP_QR_X}, SETUP_QR_Y={SETUP_QR_Y}, " - f"SETUP_QR_CELL={SETUP_QR_CELL}, SETUP_QR_PX={SETUP_QR_PX}") + # Post-180°-rotation coords for firmware (.bin is rotated in save_bin). + rot_ap_x = W - AP_QR_X - AP_QR_PX + rot_ap_y = H - AP_QR_Y - AP_QR_PX + rot_setup_x = W - SETUP_QR_X - SETUP_QR_PX + rot_setup_y = H - SETUP_QR_Y - SETUP_QR_PX + print("QR overlay constants (POST-180°-rotation) — keep these in sync with epd_driver.cpp:") + print(f" AP qr_x={rot_ap_x}, qr_y={rot_ap_y}, cell={AP_QR_CELL}, px={AP_QR_PX}") + print(f" Setup qr_x={rot_setup_x}, qr_y={rot_setup_y}, cell={SETUP_QR_CELL}, px={SETUP_QR_PX}") diff --git a/src/panels/waveshare13e6/v1/epd_driver.cpp b/src/panels/waveshare13e6/v1/epd_driver.cpp index 1a1af16..0f2ef91 100644 --- a/src/panels/waveshare13e6/v1/epd_driver.cpp +++ b/src/panels/waveshare13e6/v1/epd_driver.cpp @@ -444,14 +444,20 @@ static void draw_from_lfs(const char* path, uint8_t fallback_color, // rectangle exactly the size of QR_MODS × QR_CELL at (X, Y), and the // firmware paints the live QR into it. Mismatch = the QR draws over // decorative borders or the QR placeholder shows through. +// +// Coords are post-180°-rotation: the gen script rotates each .bin to +// compensate for the panel's ribbon-at-bottom physical mounting, so +// QR placeholders move to (W - old_x - QR_PX, H - old_y - QR_PX). +// AP (518 px QR): pre-rot 642,590 → post-rot 40,492 +// Setup (574 px QR): pre-rot 313,750 → post-rot 313,276 (X centred) void epd_draw_ap_screen(QRCode* qr) { - draw_from_lfs("/ap_bg.bin", COLOR_YELLOW, qr, 642, 590, 14); + draw_from_lfs("/ap_bg.bin", COLOR_YELLOW, qr, 40, 492, 14); } void epd_draw_ap_screen_retry(QRCode* qr) { - draw_from_lfs("/ap_bg_retry.bin", COLOR_RED, qr, 642, 590, 14); + draw_from_lfs("/ap_bg_retry.bin", COLOR_RED, qr, 40, 492, 14); } void epd_draw_setup_screen(QRCode* qr) { - draw_from_lfs("/setup_bg.bin", COLOR_GREEN, qr, 313, 750, 14); + draw_from_lfs("/setup_bg.bin", COLOR_GREEN, qr, 313, 276, 14); } diff --git a/src/panels/waveshare13e6/v1/version.h b/src/panels/waveshare13e6/v1/version.h index f7e729d..30507e8 100644 --- a/src/panels/waveshare13e6/v1/version.h +++ b/src/panels/waveshare13e6/v1/version.h @@ -3,4 +3,4 @@ // Panel-specific firmware version for the Waveshare 13.3" Spectra-6 driver. // Bump on each driver change worth correlating with server-side reports. // Independent of the shared firmware version (HTTP / NVS / sleep / etc.). -#define PANEL_FW_VERSION "v1.0.1" +#define PANEL_FW_VERSION "v1.0.2"