diff --git a/src/graphics/niche/Drivers/EInk/ED047TC1.cpp b/src/graphics/niche/Drivers/EInk/ED047TC1.cpp index 2e283737c..51072b688 100644 --- a/src/graphics/niche/Drivers/EInk/ED047TC1.cpp +++ b/src/graphics/niche/Drivers/EInk/ED047TC1.cpp @@ -6,15 +6,12 @@ FastEPD buffer format: 1bpp, horizontal bytes, MSB = leftmost pixel, 1 = white Both formats share the same pixel layout and polarity (1 = white, 0 = black). - The InkHUD safe-area buffer (944×523) is copied into the centre of the physical + The InkHUD safe-area buffer (928×508) is copied into the centre of the physical 960×540 FastEPD buffer so content clears the panel's inactive edge border. See ED047TC1.h for the H_OFFSET_BYTES / V_OFFSET_TOP / V_OFFSET_BOTTOM constants. */ -// Ruler diagnostic — uncomment to draw calibration lines at each physical edge. -// #define EINK_EDGE_LINES - #ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS #ifdef T5_S3_EPAPER_PRO @@ -212,35 +209,6 @@ void ED047TC1::update(uint8_t *imageData, UpdateTypes type) memcpy(dstRow, srcRow, srcRowBytes); } -#ifdef EINK_EDGE_LINES - // Draw a 1px black box at the exact boundary of the safe area within the - // physical buffer. If the margins are correct, all 4 lines should be - // fully visible and right at the edge of the usable display area. - - auto setPixelBlack = [&](uint32_t col, uint32_t row) { cur[row * dstRowBytes + col / 8] &= ~(0x80 >> (col % 8)); }; - - const uint32_t safeX = H_OFFSET_BYTES * 8; - const uint32_t safeY = V_OFFSET_TOP; - const uint32_t safeW = DISPLAY_WIDTH; - const uint32_t safeH = DISPLAY_HEIGHT; - - // Top edge: horizontal line at safeY - for (uint32_t col = safeX; col < safeX + safeW; col++) - setPixelBlack(col, safeY); - - // Bottom edge: horizontal line at safeY + safeH - 1 - for (uint32_t col = safeX; col < safeX + safeW; col++) - setPixelBlack(col, safeY + safeH - 1); - - // Left edge: vertical line at safeX - for (uint32_t row = safeY; row < safeY + safeH; row++) - setPixelBlack(safeX, row); - - // Right edge: vertical line at safeX + safeW - 1 - for (uint32_t row = safeY; row < safeY + safeH; row++) - setPixelBlack(safeX + safeW - 1, row); -#endif - if (type == FULL) { epaper->fullUpdate(CLEAR_SLOW, false); epaper->backupPlane(); // Sync pPrevious so next partialUpdate has a correct baseline diff --git a/src/graphics/niche/Drivers/EInk/ED047TC1.h b/src/graphics/niche/Drivers/EInk/ED047TC1.h index 3540481e7..282797f6f 100644 --- a/src/graphics/niche/Drivers/EInk/ED047TC1.h +++ b/src/graphics/niche/Drivers/EInk/ED047TC1.h @@ -18,9 +18,9 @@ V_OFFSET_TOP and V_OFFSET_BOTTOM (vertical, pixel rows) to position it. Changing these constants shifts content inward from each physical edge: - H_OFFSET_BYTES = 1 → 8px left margin, 8px right margin (960 – 8 – 8 = 944) - V_OFFSET_TOP = 9 → 9px top margin (asymmetric: top ≠ bottom) - V_OFFSET_BOTTOM = 8 → 8px bottom margin (540 – 9 – 8 = 523) + H_OFFSET_BYTES = 2 → 16px left margin, 16px right margin (960 – 16 – 16 = 928) + V_OFFSET_TOP = 16 → 16px top margin + V_OFFSET_BOTTOM = 16 → 16px bottom margin (540 – 16 – 16 = 508) */ @@ -61,13 +61,13 @@ class ED047TC1 : public EInk // // Calibrated by flashing a 1px border box and adjusting until all 4 sides are visible. - static constexpr uint16_t DISPLAY_WIDTH = 944; // 960 − H_OFFSET_BYTES×8 − right_margin (8+8 = 16px) - static constexpr uint16_t DISPLAY_HEIGHT = 523; // 540 − V_OFFSET_TOP − V_OFFSET_BOTTOM (9+8 = 17px) + static constexpr uint16_t DISPLAY_WIDTH = 928; // 960 − H_OFFSET_BYTES×8 − right_margin (16+16 = 32px) + static constexpr uint16_t DISPLAY_HEIGHT = 508; // 540 − V_OFFSET_TOP − V_OFFSET_BOTTOM (16+16 = 32px) - static constexpr uint8_t H_OFFSET_BYTES = 1; // visual TOP : 8px physical left margin - // visual BOTTOM: 960−8−944=8px physical right margin - static constexpr uint8_t V_OFFSET_TOP = 9; // visual RIGHT : CONFIRMED OK - static constexpr uint8_t V_OFFSET_BOTTOM = 8; // visual LEFT : 8px physical bottom margin + static constexpr uint8_t H_OFFSET_BYTES = 2; // visual TOP : 16px physical left margin + // visual BOTTOM: 960−16−928=16px physical right margin + static constexpr uint8_t V_OFFSET_TOP = 16; // visual RIGHT : 16px physical top margin + static constexpr uint8_t V_OFFSET_BOTTOM = 16; // visual LEFT : 16px physical bottom margin static constexpr UpdateTypes supported = static_cast(FULL | FAST); diff --git a/variants/esp32s3/t5s3_epaper/platformio.ini b/variants/esp32s3/t5s3_epaper/platformio.ini index 2001133c7..9dbb6d32d 100644 --- a/variants/esp32s3/t5s3_epaper/platformio.ini +++ b/variants/esp32s3/t5s3_epaper/platformio.ini @@ -11,7 +11,7 @@ build_flags = -fno-strict-aliasing -D USE_EINK -D USE_EINK_PARALLELDISPLAY -D PRIVATE_HW - -D TOUCH_THRESHOLD_X=60 + -D TOUCH_THRESHOLD_X=40 -D TOUCH_THRESHOLD_Y=40 -D TIME_LONG_PRESS=500 ; -D EINK_LIMIT_GHOSTING_PX=5000