rearrange USE_EINK/EPD macros, use large font

This commit is contained in:
Manuel
2025-12-08 12:59:34 +01:00
parent 4eda582d80
commit cf49b19404
16 changed files with 60 additions and 72 deletions

View File

@@ -353,7 +353,7 @@ void PowerFSM_setup()
powerFSM.add_transition(&stateDARK, &stateDARK, EVENT_CONTACT_FROM_PHONE, NULL, "Contact from phone"); powerFSM.add_transition(&stateDARK, &stateDARK, EVENT_CONTACT_FROM_PHONE, NULL, "Contact from phone");
#if defined(USE_EINK) || defined(USE_EPD) #if defined(USE_EINK)
// Allow E-Ink devices to suppress the screensaver, if screen timeout set to 0 // Allow E-Ink devices to suppress the screensaver, if screen timeout set to 0
if (config.display.screen_on_secs > 0) if (config.display.screen_on_secs > 0)
#endif #endif

View File

@@ -1,6 +1,6 @@
#include "configuration.h" #include "configuration.h"
#ifdef USE_EINK #if defined(USE_EINK) && !defined(USE_EINK_PARALLELDISPLAY)
#include "EInkDisplay2.h" #include "EInkDisplay2.h"
#include "SPILock.h" #include "SPILock.h"
#include "main.h" #include "main.h"

View File

@@ -1,6 +1,6 @@
#pragma once #pragma once
#ifdef USE_EINK #if defined(USE_EINK) && !defined(USE_EINK_PARALLELDISPLAY)
#include "GxEPD2_BW.h" #include "GxEPD2_BW.h"
#include <OLEDDisplay.h> #include <OLEDDisplay.h>

View File

@@ -1,8 +1,7 @@
#include "EInkParallelDisplay.h" #include "EInkParallelDisplay.h"
#ifdef USE_EPD #ifdef USE_EINK_PARALLELDISPLAY
#include "SPILock.h"
#include "Wire.h" #include "Wire.h"
#include "variant.h" #include "variant.h"
#include <Arduino.h> #include <Arduino.h>

View File

@@ -2,7 +2,7 @@
#include "configuration.h" #include "configuration.h"
#ifdef USE_EPD #ifdef USE_EINK_PARALLELDISPLAY
#include <OLEDDisplay.h> #include <OLEDDisplay.h>
#include <atomic> #include <atomic>

View File

@@ -155,7 +155,7 @@ void Screen::showSimpleBanner(const char *message, uint32_t durationMs)
// Called to trigger a banner with custom message and duration // Called to trigger a banner with custom message and duration
void Screen::showOverlayBanner(BannerOverlayOptions banner_overlay_options) void Screen::showOverlayBanner(BannerOverlayOptions banner_overlay_options)
{ {
#if defined(USE_EINK) || defined(USE_EPD) #if defined(USE_EINK)
EINK_ADD_FRAMEFLAG(dispdev, DEMAND_FAST); // Skip full refresh for all overlay menus EINK_ADD_FRAMEFLAG(dispdev, DEMAND_FAST); // Skip full refresh for all overlay menus
#endif #endif
// Store the message and set the expiration timestamp // Store the message and set the expiration timestamp
@@ -179,7 +179,7 @@ void Screen::showOverlayBanner(BannerOverlayOptions banner_overlay_options)
// Called to trigger a banner with custom message and duration // Called to trigger a banner with custom message and duration
void Screen::showNodePicker(const char *message, uint32_t durationMs, std::function<void(uint32_t)> bannerCallback) void Screen::showNodePicker(const char *message, uint32_t durationMs, std::function<void(uint32_t)> bannerCallback)
{ {
#if defined(USE_EINK) || defined(USE_EPD) #if defined(USE_EINK)
EINK_ADD_FRAMEFLAG(dispdev, DEMAND_FAST); // Skip full refresh for all overlay menus EINK_ADD_FRAMEFLAG(dispdev, DEMAND_FAST); // Skip full refresh for all overlay menus
#endif #endif
nodeDB->pause_sort(true); nodeDB->pause_sort(true);
@@ -202,7 +202,7 @@ void Screen::showNodePicker(const char *message, uint32_t durationMs, std::funct
void Screen::showNumberPicker(const char *message, uint32_t durationMs, uint8_t digits, void Screen::showNumberPicker(const char *message, uint32_t durationMs, uint8_t digits,
std::function<void(uint32_t)> bannerCallback) std::function<void(uint32_t)> bannerCallback)
{ {
#if defined(USE_EINK) || defined(USE_EPD) #if defined(USE_EINK)
EINK_ADD_FRAMEFLAG(dispdev, DEMAND_FAST); // Skip full refresh for all overlay menus EINK_ADD_FRAMEFLAG(dispdev, DEMAND_FAST); // Skip full refresh for all overlay menus
#endif #endif
// Store the message and set the expiration timestamp // Store the message and set the expiration timestamp
@@ -384,13 +384,13 @@ Screen::Screen(ScanI2C::DeviceAddress address, meshtastic_Config_DisplayConfig_O
defined(RAK14014) || defined(HX8357_CS) || defined(ILI9488_CS) || defined(ST7796_CS) defined(RAK14014) || defined(HX8357_CS) || defined(ILI9488_CS) || defined(ST7796_CS)
dispdev = new TFTDisplay(address.address, -1, -1, geometry, dispdev = new TFTDisplay(address.address, -1, -1, geometry,
(address.port == ScanI2C::I2CPort::WIRE1) ? HW_I2C::I2C_TWO : HW_I2C::I2C_ONE); (address.port == ScanI2C::I2CPort::WIRE1) ? HW_I2C::I2C_TWO : HW_I2C::I2C_ONE);
#elif defined(USE_EINK) && !defined(USE_EINK_DYNAMICDISPLAY) #elif defined(USE_EINK) && !defined(USE_EINK_DYNAMICDISPLAY) && !defined(USE_EINK_PARALLELDISPLAY)
dispdev = new EInkDisplay(address.address, -1, -1, geometry, dispdev = new EInkDisplay(address.address, -1, -1, geometry,
(address.port == ScanI2C::I2CPort::WIRE1) ? HW_I2C::I2C_TWO : HW_I2C::I2C_ONE); (address.port == ScanI2C::I2CPort::WIRE1) ? HW_I2C::I2C_TWO : HW_I2C::I2C_ONE);
#elif defined(USE_EINK) && defined(USE_EINK_DYNAMICDISPLAY) #elif defined(USE_EINK) && defined(USE_EINK_DYNAMICDISPLAY)
dispdev = new EInkDynamicDisplay(address.address, -1, -1, geometry, dispdev = new EInkDynamicDisplay(address.address, -1, -1, geometry,
(address.port == ScanI2C::I2CPort::WIRE1) ? HW_I2C::I2C_TWO : HW_I2C::I2C_ONE); (address.port == ScanI2C::I2CPort::WIRE1) ? HW_I2C::I2C_TWO : HW_I2C::I2C_ONE);
#elif defined(USE_EPD) #elif defined(USE_EINK_PARALLELDISPLAY)
dispdev = new EInkParallelDisplay(EPD_WIDTH, EPD_HEIGHT, EInkParallelDisplay::EPD_ROT_PORTRAIT); dispdev = new EInkParallelDisplay(EPD_WIDTH, EPD_HEIGHT, EInkParallelDisplay::EPD_ROT_PORTRAIT);
#elif defined(USE_ST7567) #elif defined(USE_ST7567)
dispdev = new ST7567Wire(address.address, -1, -1, geometry, dispdev = new ST7567Wire(address.address, -1, -1, geometry,
@@ -428,7 +428,7 @@ Screen::~Screen()
*/ */
void Screen::doDeepSleep() void Screen::doDeepSleep()
{ {
#if defined(USE_EINK) || defined(USE_EPD) #if defined(USE_EINK)
setOn(false, graphics::UIRenderer::drawDeepSleepFrame); setOn(false, graphics::UIRenderer::drawDeepSleepFrame);
#else #else
// Without E-Ink display: // Without E-Ink display:
@@ -503,7 +503,7 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver)
runASAP = true; runASAP = true;
} else { } else {
powerMon->clearState(meshtastic_PowerMon_State_Screen_On); powerMon->clearState(meshtastic_PowerMon_State_Screen_On);
#if defined(USE_EINK) || defined(USE_EPD) #if defined(USE_EINK)
// eInkScreensaver parameter is usually NULL (default argument), default frame used instead // eInkScreensaver parameter is usually NULL (default argument), default frame used instead
setScreensaverFrames(einkScreensaver); setScreensaverFrames(einkScreensaver);
#endif #endif
@@ -683,7 +683,7 @@ void Screen::setup()
handleSetOn(true); handleSetOn(true);
determineResolution(dispdev->height(), dispdev->width()); determineResolution(dispdev->height(), dispdev->width());
ui->update(); ui->update();
#if !defined(USE_EINK) && !defined(USE_EPD) #ifndef USE_EINK
ui->update(); // Some SSD1306 clones drop the first draw, so run twice ui->update(); // Some SSD1306 clones drop the first draw, so run twice
#endif #endif
serialSinceMsec = millis(); serialSinceMsec = millis();
@@ -696,7 +696,7 @@ void Screen::setup()
touchScreenImpl1->init(); touchScreenImpl1->init();
} }
} }
#elif HAS_TOUCHSCREEN && !defined(USE_EINK) && !defined(USE_EPD) && !HAS_CST226SE #elif HAS_TOUCHSCREEN && !defined(USE_EINK) && !HAS_CST226SE
touchScreenImpl1 = touchScreenImpl1 =
new TouchScreenImpl1(dispdev->getWidth(), dispdev->getHeight(), static_cast<TFTDisplay *>(dispdev)->getTouch); new TouchScreenImpl1(dispdev->getWidth(), dispdev->getHeight(), static_cast<TFTDisplay *>(dispdev)->getTouch);
touchScreenImpl1->init(); touchScreenImpl1->init();
@@ -735,7 +735,7 @@ void Screen::setOn(bool on, FrameCallback einkScreensaver)
void Screen::forceDisplay(bool forceUiUpdate) void Screen::forceDisplay(bool forceUiUpdate)
{ {
// Nasty hack to force epaper updates for 'key' frames. FIXME, cleanup. // Nasty hack to force epaper updates for 'key' frames. FIXME, cleanup.
#if defined(USE_EINK) || defined(USE_EPD) #if defined(USE_EINK)
// If requested, make sure queued commands are run, and UI has rendered a new frame // If requested, make sure queued commands are run, and UI has rendered a new frame
if (forceUiUpdate) { if (forceUiUpdate) {
// Force a display refresh, in addition to the UI update // Force a display refresh, in addition to the UI update
@@ -764,10 +764,10 @@ void Screen::forceDisplay(bool forceUiUpdate)
} }
// Tell EInk class to update the display // Tell EInk class to update the display
#if defined(USE_EINK) #if defined(USE_EINK_PARALLELDISPLAY)
static_cast<EInkDisplay *>(dispdev)->forceDisplay();
#elif defined(USE_EPD)
static_cast<EInkParallelDisplay *>(dispdev)->forceDisplay(); static_cast<EInkParallelDisplay *>(dispdev)->forceDisplay();
#elif defined(USE_EINK)
static_cast<EInkDisplay *>(dispdev)->forceDisplay();
#endif #endif
#else #else
// No delay between UI frame rendering // No delay between UI frame rendering
@@ -810,7 +810,7 @@ int32_t Screen::runOnce()
static const int bootOEMFrameCount = sizeof(bootOEMFrames) / sizeof(bootOEMFrames[0]); static const int bootOEMFrameCount = sizeof(bootOEMFrames) / sizeof(bootOEMFrames[0]);
ui->setFrames(bootOEMFrames, bootOEMFrameCount); ui->setFrames(bootOEMFrames, bootOEMFrameCount);
ui->update(); ui->update();
#if !defined(USE_EINK) && !defined(USE_EPD) #ifndef USE_EINK
ui->update(); ui->update();
#endif #endif
showingOEMBootScreen = false; showingOEMBootScreen = false;
@@ -863,7 +863,7 @@ int32_t Screen::runOnce()
showingNormalScreen = false; showingNormalScreen = false;
NotificationRenderer::pauseBanner = true; NotificationRenderer::pauseBanner = true;
alertFrames[0] = alertFrame; alertFrames[0] = alertFrame;
#if defined(USE_EINK) || defined(USE_EPD) #if defined(USE_EINK)
EINK_ADD_FRAMEFLAG(dispdev, DEMAND_FAST); // Use fast-refresh for next frame, no skip please EINK_ADD_FRAMEFLAG(dispdev, DEMAND_FAST); // Use fast-refresh for next frame, no skip please
EINK_ADD_FRAMEFLAG(dispdev, BLOCKING); // Edge case: if this frame is promoted to COSMETIC, wait for update EINK_ADD_FRAMEFLAG(dispdev, BLOCKING); // Edge case: if this frame is promoted to COSMETIC, wait for update
handleSetOn(true); // Ensure power-on to receive deep-sleep screensaver (PowerFSM should handle?) handleSetOn(true); // Ensure power-on to receive deep-sleep screensaver (PowerFSM should handle?)
@@ -950,7 +950,7 @@ void Screen::setSSLFrames()
} }
} }
#if defined(USE_EINK) || defined(USE_EPD) #if defined(USE_EINK)
/// Determine which screensaver frame to use, then set the FrameCallback /// Determine which screensaver frame to use, then set the FrameCallback
void Screen::setScreensaverFrames(FrameCallback einkScreensaver) void Screen::setScreensaverFrames(FrameCallback einkScreensaver)
{ {
@@ -985,13 +985,11 @@ void Screen::setScreensaverFrames(FrameCallback einkScreensaver)
ui->update(); ui->update();
} while (ui->getUiState()->lastUpdate < startUpdate); } while (ui->getUiState()->lastUpdate < startUpdate);
#if defined(USE_EINK_PARALLELDISPLAY)
static_cast<EInkParallelDisplay *>(dispdev)->forceDisplay(0);
#elif defined(USE_EINK) && !defined(USE_EINK_DYNAMICDISPLAY)
// Old EInkDisplay class // Old EInkDisplay class
#if !defined(USE_EINK_DYNAMICDISPLAY)
#if defined(USE_EINK)
static_cast<EInkDisplay *>(dispdev)->forceDisplay(0); // Screen::forceDisplay(), but override rate-limit static_cast<EInkDisplay *>(dispdev)->forceDisplay(0); // Screen::forceDisplay(), but override rate-limit
#elif defined(USE_EPD)
static_cast<EInkParallelDisplay *>(dispdev)->forceDisplay(0); // Screen::forceDisplay(), but override rate-limit
#endif
#endif #endif
// Prepare now for next frame, shown when display wakes // Prepare now for next frame, shown when display wakes
@@ -1063,7 +1061,7 @@ void Screen::setFrames(FrameFocus focus)
normalFrames[numframes++] = graphics::MessageRenderer::drawTextMessageFrame; normalFrames[numframes++] = graphics::MessageRenderer::drawTextMessageFrame;
indicatorIcons.push_back(icon_mail); indicatorIcons.push_back(icon_mail);
#if !defined(USE_EINK) && !defined(USE_EPD) #if !defined(USE_EINK)
if (!hiddenFrames.nodelist) { if (!hiddenFrames.nodelist) {
fsi.positions.nodelist = numframes; fsi.positions.nodelist = numframes;
normalFrames[numframes++] = graphics::NodeListRenderer::drawDynamicNodeListScreen; normalFrames[numframes++] = graphics::NodeListRenderer::drawDynamicNodeListScreen;
@@ -1072,7 +1070,7 @@ void Screen::setFrames(FrameFocus focus)
#endif #endif
// Show detailed node views only on E-Ink builds // Show detailed node views only on E-Ink builds
#if defined(USE_EINK) || defined(USE_EPD) #if defined(USE_EINK)
if (!hiddenFrames.nodelist_lastheard) { if (!hiddenFrames.nodelist_lastheard) {
fsi.positions.nodelist_lastheard = numframes; fsi.positions.nodelist_lastheard = numframes;
normalFrames[numframes++] = graphics::NodeListRenderer::drawLastHeardScreen; normalFrames[numframes++] = graphics::NodeListRenderer::drawLastHeardScreen;
@@ -1259,12 +1257,12 @@ void Screen::setFrameImmediateDraw(FrameCallback *drawFrames)
void Screen::toggleFrameVisibility(const std::string &frameName) void Screen::toggleFrameVisibility(const std::string &frameName)
{ {
#if !defined(USE_EINK) && !defined(USE_EPD) #if !defined(USE_EINK)
if (frameName == "nodelist") { if (frameName == "nodelist") {
hiddenFrames.nodelist = !hiddenFrames.nodelist; hiddenFrames.nodelist = !hiddenFrames.nodelist;
} }
#endif #endif
#if defined(USE_EINK) || defined(USE_EPD) #if defined(USE_EINK)
if (frameName == "nodelist_lastheard") { if (frameName == "nodelist_lastheard") {
hiddenFrames.nodelist_lastheard = !hiddenFrames.nodelist_lastheard; hiddenFrames.nodelist_lastheard = !hiddenFrames.nodelist_lastheard;
} }
@@ -1299,11 +1297,11 @@ void Screen::toggleFrameVisibility(const std::string &frameName)
bool Screen::isFrameHidden(const std::string &frameName) const bool Screen::isFrameHidden(const std::string &frameName) const
{ {
#if !defined(USE_EINK) && !defined(USE_EPD) #if !defined(USE_EINK)
if (frameName == "nodelist") if (frameName == "nodelist")
return hiddenFrames.nodelist; return hiddenFrames.nodelist;
#endif #endif
#if defined(USE_EINK) || defined(USE_EPD) #if defined(USE_EINK)
if (frameName == "nodelist_lastheard") if (frameName == "nodelist_lastheard")
return hiddenFrames.nodelist_lastheard; return hiddenFrames.nodelist_lastheard;
if (frameName == "nodelist_hopsignal") if (frameName == "nodelist_hopsignal")
@@ -1629,7 +1627,7 @@ int Screen::handleInputEvent(const InputEvent *event)
return 0; return 0;
} }
#if defined(USE_EINK) || defined(USE_EPD) // the screen is the last input handler, so if an event makes it here, we can assume it #if defined(USE_EINK) // the screen is the last input handler, so if an event makes it here, we can assume it
// will prompt a screen draw. // will prompt a screen draw.
EINK_ADD_FRAMEFLAG(dispdev, DEMAND_FAST); // Use fast-refresh for next frame, no skip please EINK_ADD_FRAMEFLAG(dispdev, DEMAND_FAST); // Use fast-refresh for next frame, no skip please
EINK_ADD_FRAMEFLAG(dispdev, BLOCKING); // Edge case: if this frame is promoted to COSMETIC, wait for update EINK_ADD_FRAMEFLAG(dispdev, BLOCKING); // Edge case: if this frame is promoted to COSMETIC, wait for update

View File

@@ -597,7 +597,7 @@ class Screen : public concurrency::OSThread
void toggleFrameVisibility(const std::string &frameName); void toggleFrameVisibility(const std::string &frameName);
bool isFrameHidden(const std::string &frameName) const; bool isFrameHidden(const std::string &frameName) const;
#if defined(USE_EINK) || defined(USE_EPD) #if defined(USE_EINK)
/// Draw an image to remain on E-Ink display after screen off /// Draw an image to remain on E-Ink display after screen off
void setScreensaverFrames(FrameCallback einkScreensaver = NULL); void setScreensaverFrames(FrameCallback einkScreensaver = NULL);
#endif #endif
@@ -686,7 +686,7 @@ class Screen : public concurrency::OSThread
#ifndef USE_EINK #ifndef USE_EINK
bool nodelist = false; bool nodelist = false;
#endif #endif
#if defined(USE_EINK) || defined(USE_EPD) #if defined(USE_EINK)
bool nodelist_lastheard = false; bool nodelist_lastheard = false;
bool nodelist_hopsignal = false; bool nodelist_hopsignal = false;
bool nodelist_distance = false; bool nodelist_distance = false;

View File

@@ -16,7 +16,7 @@
#include "graphics/fonts/OLEDDisplayFontsCS.h" #include "graphics/fonts/OLEDDisplayFontsCS.h"
#endif #endif
#if defined(CROWPANEL_ESP32S3_5_EPAPER) && defined(USE_EINK) #if defined(CROWPANEL_ESP32S3_5_EPAPER) || defined(T5_S3_EPAPER_PRO)
#include "graphics/fonts/EinkDisplayFonts.h" #include "graphics/fonts/EinkDisplayFonts.h"
#endif #endif
@@ -80,11 +80,11 @@
#define FONT_SMALL FONT_MEDIUM_LOCAL // Height: 19 #define FONT_SMALL FONT_MEDIUM_LOCAL // Height: 19
#define FONT_MEDIUM FONT_LARGE_LOCAL // Height: 28 #define FONT_MEDIUM FONT_LARGE_LOCAL // Height: 28
#define FONT_LARGE FONT_LARGE_LOCAL // Height: 28 #define FONT_LARGE FONT_LARGE_LOCAL // Height: 28
#elif defined(M5STACK_UNITC6L) #elif 0 // defined(M5STACK_UNITC6L)
#define FONT_SMALL FONT_SMALL_LOCAL // Height: 13 #define FONT_SMALL FONT_SMALL_LOCAL // Height: 13
#define FONT_MEDIUM FONT_SMALL_LOCAL // Height: 13 #define FONT_MEDIUM FONT_SMALL_LOCAL // Height: 13
#define FONT_LARGE FONT_SMALL_LOCAL // Height: 13 #define FONT_LARGE FONT_SMALL_LOCAL // Height: 13
#elif defined(USE_EPD) #elif defined(T5_S3_EPAPER_PRO)
#define FONT_SMALL FONT_LARGE_LOCAL // Height: 28 #define FONT_SMALL FONT_LARGE_LOCAL // Height: 28
#define FONT_MEDIUM FONT_LARGE_LOCAL // Height: 28 #define FONT_MEDIUM FONT_LARGE_LOCAL // Height: 28
#define FONT_LARGE FONT_LARGE_LOCAL // Height: 28 #define FONT_LARGE FONT_LARGE_LOCAL // Height: 28
@@ -94,7 +94,7 @@
#define FONT_LARGE FONT_LARGE_LOCAL // Height: 28 #define FONT_LARGE FONT_LARGE_LOCAL // Height: 28
#endif #endif
#if defined(CROWPANEL_ESP32S3_5_EPAPER) && defined(USE_EINK) #if defined(CROWPANEL_ESP32S3_5_EPAPER) || defined(T5_S3_EPAPER_PRO)
#undef FONT_SMALL #undef FONT_SMALL
#undef FONT_MEDIUM #undef FONT_MEDIUM
#undef FONT_LARGE #undef FONT_LARGE

View File

@@ -1491,11 +1491,11 @@ void menuHandler::FrameToggles_menu()
// Track last selected index (not enum value!) // Track last selected index (not enum value!)
static int lastSelectedIndex = 0; static int lastSelectedIndex = 0;
#if !defined(USE_EINK) && !defined(USE_EPD) #if !defined(USE_EINK)
optionsArray[options] = screen->isFrameHidden("nodelist") ? "Show Node List" : "Hide Node List"; optionsArray[options] = screen->isFrameHidden("nodelist") ? "Show Node List" : "Hide Node List";
optionsEnumArray[options++] = nodelist; optionsEnumArray[options++] = nodelist;
#endif #endif
#if defined(USE_EINK) || defined(USE_EPD) #if defined(USE_EINK)
optionsArray[options] = screen->isFrameHidden("nodelist_lastheard") ? "Show NL - Last Heard" : "Hide NL - Last Heard"; optionsArray[options] = screen->isFrameHidden("nodelist_lastheard") ? "Show NL - Last Heard" : "Hide NL - Last Heard";
optionsEnumArray[options++] = nodelist_lastheard; optionsEnumArray[options++] = nodelist_lastheard;
optionsArray[options] = screen->isFrameHidden("nodelist_hopsignal") ? "Show NL - Hops/Signal" : "Hide NL - Hops/Signal"; optionsArray[options] = screen->isFrameHidden("nodelist_hopsignal") ? "Show NL - Hops/Signal" : "Hide NL - Hops/Signal";

View File

@@ -549,7 +549,7 @@ void drawDynamicNodeListScreen(OLEDDisplay *display, OLEDDisplayUiState *state,
} }
#endif #endif
#if defined(USE_EINK) || defined(USE_EPD) #if defined(USE_EINK)
void drawLastHeardScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) void drawLastHeardScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
{ {
const char *title = "Last Heard"; const char *title = "Last Heard";
@@ -558,7 +558,7 @@ void drawLastHeardScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_
void drawHopSignalScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) void drawHopSignalScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
{ {
#if defined(USE_EINK) || defined(USE_EPD) #if defined(USE_EINK)
const char *title = "Hops/Sig"; const char *title = "Hops/Sig";
#else #else

View File

@@ -256,9 +256,9 @@ void UIRenderer::drawNodes(OLEDDisplay *display, int16_t x, int16_t y, const mes
snprintf(usersString, sizeof(usersString), "%d/%d %s", nodes_online, nodes_total, additional_words.c_str()); snprintf(usersString, sizeof(usersString), "%d/%d %s", nodes_online, nodes_total, additional_words.c_str());
} }
#if (defined(USE_EINK) || defined(USE_EPD) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || \ #if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \
defined(ST7735_CS) || defined(ST7789_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(HX8357_CS) || \ defined(ST7789_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(HX8357_CS) || defined(ST7796_CS) || \
defined(ST7796_CS) || defined(USE_ST7796)) && \ defined(USE_ST7796)) && \
!defined(DISPLAY_FORCE_SMALL_FONTS) !defined(DISPLAY_FORCE_SMALL_FONTS)
if (isHighResolution) { if (isHighResolution) {
@@ -500,7 +500,7 @@ void UIRenderer::drawNodeInfo(OLEDDisplay *display, const OLEDDisplayUiState *st
: getTextPositions(display)[1]; : getTextPositions(display)[1];
const int margin = 4; const int margin = 4;
// --------- PATCH FOR EINK NAV BAR (ONLY CHANGE BELOW) ----------- // --------- PATCH FOR EINK NAV BAR (ONLY CHANGE BELOW) -----------
#if defined(USE_EINK) || defined(USE_EPD) #if defined(USE_EINK)
const int iconSize = (isHighResolution) ? 16 : 8; const int iconSize = (isHighResolution) ? 16 : 8;
const int navBarHeight = iconSize + 6; const int navBarHeight = iconSize + 6;
#else #else
@@ -836,7 +836,7 @@ bool UIRenderer::haveGlyphs(const char *str)
return have; return have;
} }
#if defined(USE_EINK) || defined(USE_EPD) #if defined(USE_EINK)
/// Used on eink displays while in deep sleep /// Used on eink displays while in deep sleep
void UIRenderer::drawDeepSleepFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) void UIRenderer::drawDeepSleepFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
{ {
@@ -1032,7 +1032,7 @@ void UIRenderer::drawCompassAndLocationScreen(OLEDDisplay *display, OLEDDisplayU
if (gpsStatus->getLastFixMillis() > 0) { if (gpsStatus->getLastFixMillis() > 0) {
uint32_t delta = millis() - gpsStatus->getLastFixMillis(); uint32_t delta = millis() - gpsStatus->getLastFixMillis();
char uptimeStr[32]; char uptimeStr[32];
#if defined(USE_EINK) || defined(USE_EPD) #if defined(USE_EINK)
// E-Ink: skip seconds, show only days/hours/mins // E-Ink: skip seconds, show only days/hours/mins
getUptimeStr(delta, "Last", uptimeStr, sizeof(uptimeStr), false); getUptimeStr(delta, "Last", uptimeStr, sizeof(uptimeStr), false);
#else #else
@@ -1107,7 +1107,7 @@ void UIRenderer::drawCompassAndLocationScreen(OLEDDisplay *display, OLEDDisplayU
int yBelowContent = getTextPositions(display)[5] + FONT_HEIGHT_SMALL + 2; int yBelowContent = getTextPositions(display)[5] + FONT_HEIGHT_SMALL + 2;
const int margin = 4; const int margin = 4;
int availableHeight = int availableHeight =
#if defined(USE_EINK) || defined(USE_EPD) #if defined(USE_EINK)
SCREEN_HEIGHT - yBelowContent - 24; // Leave extra space for nav bar on E-Ink SCREEN_HEIGHT - yBelowContent - 24; // Leave extra space for nav bar on E-Ink
#else #else
SCREEN_HEIGHT - yBelowContent - margin; SCREEN_HEIGHT - yBelowContent - margin;
@@ -1250,7 +1250,7 @@ void UIRenderer::drawNavigationBar(OLEDDisplay *display, OLEDDisplayUiState *sta
bool navBarVisible = millis() - lastFrameChangeTime <= ICON_DISPLAY_DURATION_MS; bool navBarVisible = millis() - lastFrameChangeTime <= ICON_DISPLAY_DURATION_MS;
int y = navBarVisible ? (SCREEN_HEIGHT - iconSize - 1) : SCREEN_HEIGHT; int y = navBarVisible ? (SCREEN_HEIGHT - iconSize - 1) : SCREEN_HEIGHT;
#if defined(USE_EINK) || defined(USE_EPD) #if defined(USE_EINK)
// Only show bar briefly after switching frames // Only show bar briefly after switching frames
static uint32_t navBarLastShown = 0; static uint32_t navBarLastShown = 0;
static bool cosmeticRefreshDone = false; static bool cosmeticRefreshDone = false;

View File

@@ -72,7 +72,7 @@ class UIRenderer
static void drawOEMBootScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); static void drawOEMBootScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y);
#endif #endif
#if defined(USE_EINK) || defined(USE_EPD) #if defined(USE_EINK)
/// Used on eink displays while in deep sleep /// Used on eink displays while in deep sleep
static void drawDeepSleepFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); static void drawDeepSleepFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y);

View File

@@ -888,7 +888,7 @@ void setup()
#if defined(ST7701_CS) || defined(ST7735_CS) || defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || \ #if defined(ST7701_CS) || defined(ST7735_CS) || defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || \
defined(ST7789_CS) || defined(HX8357_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(ST7796_CS) || \ defined(ST7789_CS) || defined(HX8357_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(ST7796_CS) || \
defined(USE_ST7796) || defined(USE_SPISSD1306) || defined(USE_EPD) defined(USE_ST7796) || defined(USE_SPISSD1306)
screen = new graphics::Screen(screen_found, screen_model, screen_geometry); screen = new graphics::Screen(screen_found, screen_model, screen_geometry);
#elif defined(ARCH_PORTDUINO) #elif defined(ARCH_PORTDUINO)
if ((screen_found.port != ScanI2C::I2CPort::NO_I2C || portduino_config.displayPanel) && if ((screen_found.port != ScanI2C::I2CPort::NO_I2C || portduino_config.displayPanel) &&
@@ -1143,12 +1143,6 @@ void setup()
#endif #endif
#if defined(T5_S3_EPAPER_PRO)
// this must be defined here before LoRa is setup, but after the epaper display is initialised,
// as the FastEPD driver also messes around with the IO expander and uses non-arduino I2C calls
lateInitVariant_T5S3Pro();
#endif
#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS #ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS
// After modules are setup, so we can observe modules // After modules are setup, so we can observe modules
setupNicheGraphics(); setupNicheGraphics();
@@ -1171,7 +1165,7 @@ void setup()
// the current region name) // the current region name)
#if defined(ST7701_CS) || defined(ST7735_CS) || defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || \ #if defined(ST7701_CS) || defined(ST7735_CS) || defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || \
defined(ST7789_CS) || defined(HX8357_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(ST7796_CS) || \ defined(ST7789_CS) || defined(HX8357_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(ST7796_CS) || \
defined(USE_ST7796) || defined(USE_SPISSD1306) || defined(USE_EPD) defined(USE_ST7796) || defined(USE_SPISSD1306)
if (screen) if (screen)
screen->setup(); screen->setup();
#elif defined(ARCH_PORTDUINO) #elif defined(ARCH_PORTDUINO)

View File

@@ -2,7 +2,6 @@
#ifdef T5_S3_EPAPER_PRO #ifdef T5_S3_EPAPER_PRO
#include "SPILock.h"
#include "TouchDrvGT911.hpp" #include "TouchDrvGT911.hpp"
#include "Wire.h" #include "Wire.h"
#include "input/TouchScreenImpl1.h" #include "input/TouchScreenImpl1.h"
@@ -12,10 +11,9 @@ TouchDrvGT911 touch;
bool readTouch(int16_t *x, int16_t *y) bool readTouch(int16_t *x, int16_t *y)
{ {
if (!digitalRead(GT911_PIN_INT)) { if (!digitalRead(GT911_PIN_INT)) {
concurrency::LockGuard g(spiLock);
int16_t raw_x; int16_t raw_x;
int16_t raw_y; int16_t raw_y;
if (touch.getPoint(&raw_x, &raw_y) /*&& (*x >= 0) && (*y >= 0) && (*x < EPD_WIDTH) && (*y < EPD_HEIGHT)*/) { if (touch.getPoint(&raw_x, &raw_y)) {
// rotate 90° for landscape // rotate 90° for landscape
*x = raw_y; *x = raw_y;
*y = EPD_WIDTH - 1 - raw_x; *y = EPD_WIDTH - 1 - raw_x;
@@ -27,9 +25,8 @@ bool readTouch(int16_t *x, int16_t *y)
} }
// T5-S3-ePaper Pro specific (late-) init // T5-S3-ePaper Pro specific (late-) init
void lateInitVariant_T5S3Pro(void) void lateInitVariant(void)
{ {
concurrency::LockGuard g(spiLock);
touch.setPins(GT911_PIN_RST, GT911_PIN_INT); touch.setPins(GT911_PIN_RST, GT911_PIN_INT);
if (touch.begin(Wire, GT911_SLAVE_ADDRESS_L, GT911_PIN_SDA, GT911_PIN_SCL)) { if (touch.begin(Wire, GT911_SLAVE_ADDRESS_L, GT911_PIN_SDA, GT911_PIN_SCL)) {
touchScreenImpl1 = new TouchScreenImpl1(EPD_WIDTH, EPD_HEIGHT, readTouch); touchScreenImpl1 = new TouchScreenImpl1(EPD_WIDTH, EPD_HEIGHT, readTouch);

View File

@@ -8,15 +8,15 @@ build_flags = -fno-strict-aliasing
${esp32_base.build_flags} ${esp32_base.build_flags}
-I variants/esp32s3/t5s3_epaper -I variants/esp32s3/t5s3_epaper
-D T5_S3_EPAPER_PRO -D T5_S3_EPAPER_PRO
-D USE_EINK
-D USE_EINK_PARALLELDISPLAY
-D PRIVATE_HW -D PRIVATE_HW
-D TOUCH_THRESHOLD_X=60 -D TOUCH_THRESHOLD_X=60
-D TOUCH_THRESHOLD_Y=40 -D TOUCH_THRESHOLD_Y=40
-D TIME_LONG_PRESS=500 -D TIME_LONG_PRESS=500
-D CONFIG_DISABLE_HAL_LOCKS=1 ; we use SPILock instead
; -D EINK_LIMIT_GHOSTING_PX=5000 ; -D EINK_LIMIT_GHOSTING_PX=5000
-D EPD_FULLSLOW_PERIOD=100 -D EPD_FULLSLOW_PERIOD=100
-D FAST_EPD_PARTIAL_UPDATE_BUG -D FAST_EPD_PARTIAL_UPDATE_BUG ; use rect area update instead of partial
; -D GPS_POWER_TOGGLE
build_src_filter = build_src_filter =
${esp32s3_base.build_src_filter} ${esp32s3_base.build_src_filter}
@@ -55,3 +55,4 @@ build_flags =
${t5s3_epaper_base.build_flags} ${t5s3_epaper_base.build_flags}
-D T5_S3_EPAPER_PRO_V2 -D T5_S3_EPAPER_PRO_V2
-D SDCARD_USE_SPI1 -D SDCARD_USE_SPI1
-D GPS_POWER_TOGGLE

View File

@@ -1,6 +1,5 @@
// Display (E-Ink) ED047TC1 - 8bit parallel // Display (E-Ink) ED047TC1 - 8bit parallel
#define USE_EPD
#define EPD_WIDTH 960 #define EPD_WIDTH 960
#define EPD_HEIGHT 540 #define EPD_HEIGHT 540