mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-22 02:32:23 +00:00
rearrange USE_EINK/EPD macros, use large font
This commit is contained in:
@@ -353,7 +353,7 @@ void PowerFSM_setup()
|
||||
|
||||
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
|
||||
if (config.display.screen_on_secs > 0)
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "configuration.h"
|
||||
|
||||
#ifdef USE_EINK
|
||||
#if defined(USE_EINK) && !defined(USE_EINK_PARALLELDISPLAY)
|
||||
#include "EInkDisplay2.h"
|
||||
#include "SPILock.h"
|
||||
#include "main.h"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef USE_EINK
|
||||
#if defined(USE_EINK) && !defined(USE_EINK_PARALLELDISPLAY)
|
||||
|
||||
#include "GxEPD2_BW.h"
|
||||
#include <OLEDDisplay.h>
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#include "EInkParallelDisplay.h"
|
||||
|
||||
#ifdef USE_EPD
|
||||
#ifdef USE_EINK_PARALLELDISPLAY
|
||||
|
||||
#include "SPILock.h"
|
||||
#include "Wire.h"
|
||||
#include "variant.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "configuration.h"
|
||||
|
||||
#ifdef USE_EPD
|
||||
#ifdef USE_EINK_PARALLELDISPLAY
|
||||
#include <OLEDDisplay.h>
|
||||
|
||||
#include <atomic>
|
||||
|
||||
@@ -155,7 +155,7 @@ void Screen::showSimpleBanner(const char *message, uint32_t durationMs)
|
||||
// Called to trigger a banner with custom message and duration
|
||||
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
|
||||
#endif
|
||||
// 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
|
||||
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
|
||||
#endif
|
||||
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,
|
||||
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
|
||||
#endif
|
||||
// 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)
|
||||
dispdev = new TFTDisplay(address.address, -1, -1, geometry,
|
||||
(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,
|
||||
(address.port == ScanI2C::I2CPort::WIRE1) ? HW_I2C::I2C_TWO : HW_I2C::I2C_ONE);
|
||||
#elif defined(USE_EINK) && defined(USE_EINK_DYNAMICDISPLAY)
|
||||
dispdev = new EInkDynamicDisplay(address.address, -1, -1, geometry,
|
||||
(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);
|
||||
#elif defined(USE_ST7567)
|
||||
dispdev = new ST7567Wire(address.address, -1, -1, geometry,
|
||||
@@ -428,7 +428,7 @@ Screen::~Screen()
|
||||
*/
|
||||
void Screen::doDeepSleep()
|
||||
{
|
||||
#if defined(USE_EINK) || defined(USE_EPD)
|
||||
#if defined(USE_EINK)
|
||||
setOn(false, graphics::UIRenderer::drawDeepSleepFrame);
|
||||
#else
|
||||
// Without E-Ink display:
|
||||
@@ -503,7 +503,7 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver)
|
||||
runASAP = true;
|
||||
} else {
|
||||
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
|
||||
setScreensaverFrames(einkScreensaver);
|
||||
#endif
|
||||
@@ -683,7 +683,7 @@ void Screen::setup()
|
||||
handleSetOn(true);
|
||||
determineResolution(dispdev->height(), dispdev->width());
|
||||
ui->update();
|
||||
#if !defined(USE_EINK) && !defined(USE_EPD)
|
||||
#ifndef USE_EINK
|
||||
ui->update(); // Some SSD1306 clones drop the first draw, so run twice
|
||||
#endif
|
||||
serialSinceMsec = millis();
|
||||
@@ -696,7 +696,7 @@ void Screen::setup()
|
||||
touchScreenImpl1->init();
|
||||
}
|
||||
}
|
||||
#elif HAS_TOUCHSCREEN && !defined(USE_EINK) && !defined(USE_EPD) && !HAS_CST226SE
|
||||
#elif HAS_TOUCHSCREEN && !defined(USE_EINK) && !HAS_CST226SE
|
||||
touchScreenImpl1 =
|
||||
new TouchScreenImpl1(dispdev->getWidth(), dispdev->getHeight(), static_cast<TFTDisplay *>(dispdev)->getTouch);
|
||||
touchScreenImpl1->init();
|
||||
@@ -735,7 +735,7 @@ void Screen::setOn(bool on, FrameCallback einkScreensaver)
|
||||
void Screen::forceDisplay(bool forceUiUpdate)
|
||||
{
|
||||
// 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 (forceUiUpdate) {
|
||||
// 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
|
||||
#if defined(USE_EINK)
|
||||
static_cast<EInkDisplay *>(dispdev)->forceDisplay();
|
||||
#elif defined(USE_EPD)
|
||||
#if defined(USE_EINK_PARALLELDISPLAY)
|
||||
static_cast<EInkParallelDisplay *>(dispdev)->forceDisplay();
|
||||
#elif defined(USE_EINK)
|
||||
static_cast<EInkDisplay *>(dispdev)->forceDisplay();
|
||||
#endif
|
||||
#else
|
||||
// No delay between UI frame rendering
|
||||
@@ -810,7 +810,7 @@ int32_t Screen::runOnce()
|
||||
static const int bootOEMFrameCount = sizeof(bootOEMFrames) / sizeof(bootOEMFrames[0]);
|
||||
ui->setFrames(bootOEMFrames, bootOEMFrameCount);
|
||||
ui->update();
|
||||
#if !defined(USE_EINK) && !defined(USE_EPD)
|
||||
#ifndef USE_EINK
|
||||
ui->update();
|
||||
#endif
|
||||
showingOEMBootScreen = false;
|
||||
@@ -863,7 +863,7 @@ int32_t Screen::runOnce()
|
||||
showingNormalScreen = false;
|
||||
NotificationRenderer::pauseBanner = true;
|
||||
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, 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?)
|
||||
@@ -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
|
||||
void Screen::setScreensaverFrames(FrameCallback einkScreensaver)
|
||||
{
|
||||
@@ -985,13 +985,11 @@ void Screen::setScreensaverFrames(FrameCallback einkScreensaver)
|
||||
ui->update();
|
||||
} 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
|
||||
#if !defined(USE_EINK_DYNAMICDISPLAY)
|
||||
#if defined(USE_EINK)
|
||||
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
|
||||
|
||||
// Prepare now for next frame, shown when display wakes
|
||||
@@ -1063,7 +1061,7 @@ void Screen::setFrames(FrameFocus focus)
|
||||
normalFrames[numframes++] = graphics::MessageRenderer::drawTextMessageFrame;
|
||||
indicatorIcons.push_back(icon_mail);
|
||||
|
||||
#if !defined(USE_EINK) && !defined(USE_EPD)
|
||||
#if !defined(USE_EINK)
|
||||
if (!hiddenFrames.nodelist) {
|
||||
fsi.positions.nodelist = numframes;
|
||||
normalFrames[numframes++] = graphics::NodeListRenderer::drawDynamicNodeListScreen;
|
||||
@@ -1072,7 +1070,7 @@ void Screen::setFrames(FrameFocus focus)
|
||||
#endif
|
||||
|
||||
// Show detailed node views only on E-Ink builds
|
||||
#if defined(USE_EINK) || defined(USE_EPD)
|
||||
#if defined(USE_EINK)
|
||||
if (!hiddenFrames.nodelist_lastheard) {
|
||||
fsi.positions.nodelist_lastheard = numframes;
|
||||
normalFrames[numframes++] = graphics::NodeListRenderer::drawLastHeardScreen;
|
||||
@@ -1259,12 +1257,12 @@ void Screen::setFrameImmediateDraw(FrameCallback *drawFrames)
|
||||
|
||||
void Screen::toggleFrameVisibility(const std::string &frameName)
|
||||
{
|
||||
#if !defined(USE_EINK) && !defined(USE_EPD)
|
||||
#if !defined(USE_EINK)
|
||||
if (frameName == "nodelist") {
|
||||
hiddenFrames.nodelist = !hiddenFrames.nodelist;
|
||||
}
|
||||
#endif
|
||||
#if defined(USE_EINK) || defined(USE_EPD)
|
||||
#if defined(USE_EINK)
|
||||
if (frameName == "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
|
||||
{
|
||||
#if !defined(USE_EINK) && !defined(USE_EPD)
|
||||
#if !defined(USE_EINK)
|
||||
if (frameName == "nodelist")
|
||||
return hiddenFrames.nodelist;
|
||||
#endif
|
||||
#if defined(USE_EINK) || defined(USE_EPD)
|
||||
#if defined(USE_EINK)
|
||||
if (frameName == "nodelist_lastheard")
|
||||
return hiddenFrames.nodelist_lastheard;
|
||||
if (frameName == "nodelist_hopsignal")
|
||||
@@ -1629,7 +1627,7 @@ int Screen::handleInputEvent(const InputEvent *event)
|
||||
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.
|
||||
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
|
||||
|
||||
@@ -597,7 +597,7 @@ class Screen : public concurrency::OSThread
|
||||
void toggleFrameVisibility(const std::string &frameName);
|
||||
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
|
||||
void setScreensaverFrames(FrameCallback einkScreensaver = NULL);
|
||||
#endif
|
||||
@@ -686,7 +686,7 @@ class Screen : public concurrency::OSThread
|
||||
#ifndef USE_EINK
|
||||
bool nodelist = false;
|
||||
#endif
|
||||
#if defined(USE_EINK) || defined(USE_EPD)
|
||||
#if defined(USE_EINK)
|
||||
bool nodelist_lastheard = false;
|
||||
bool nodelist_hopsignal = false;
|
||||
bool nodelist_distance = false;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include "graphics/fonts/OLEDDisplayFontsCS.h"
|
||||
#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"
|
||||
#endif
|
||||
|
||||
@@ -80,11 +80,11 @@
|
||||
#define FONT_SMALL FONT_MEDIUM_LOCAL // Height: 19
|
||||
#define FONT_MEDIUM 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_MEDIUM 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_MEDIUM 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
|
||||
#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_MEDIUM
|
||||
#undef FONT_LARGE
|
||||
|
||||
@@ -1491,11 +1491,11 @@ void menuHandler::FrameToggles_menu()
|
||||
// Track last selected index (not enum value!)
|
||||
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";
|
||||
optionsEnumArray[options++] = nodelist;
|
||||
#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";
|
||||
optionsEnumArray[options++] = nodelist_lastheard;
|
||||
optionsArray[options] = screen->isFrameHidden("nodelist_hopsignal") ? "Show NL - Hops/Signal" : "Hide NL - Hops/Signal";
|
||||
|
||||
@@ -549,7 +549,7 @@ void drawDynamicNodeListScreen(OLEDDisplay *display, OLEDDisplayUiState *state,
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(USE_EINK) || defined(USE_EPD)
|
||||
#if defined(USE_EINK)
|
||||
void drawLastHeardScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
||||
{
|
||||
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)
|
||||
{
|
||||
#if defined(USE_EINK) || defined(USE_EPD)
|
||||
#if defined(USE_EINK)
|
||||
const char *title = "Hops/Sig";
|
||||
#else
|
||||
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
#if (defined(USE_EINK) || defined(USE_EPD) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || \
|
||||
defined(ST7735_CS) || defined(ST7789_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(HX8357_CS) || \
|
||||
defined(ST7796_CS) || defined(USE_ST7796)) && \
|
||||
#if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \
|
||||
defined(ST7789_CS) || defined(USE_ST7789) || defined(ILI9488_CS) || defined(HX8357_CS) || defined(ST7796_CS) || \
|
||||
defined(USE_ST7796)) && \
|
||||
!defined(DISPLAY_FORCE_SMALL_FONTS)
|
||||
|
||||
if (isHighResolution) {
|
||||
@@ -500,7 +500,7 @@ void UIRenderer::drawNodeInfo(OLEDDisplay *display, const OLEDDisplayUiState *st
|
||||
: getTextPositions(display)[1];
|
||||
const int margin = 4;
|
||||
// --------- 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 navBarHeight = iconSize + 6;
|
||||
#else
|
||||
@@ -836,7 +836,7 @@ bool UIRenderer::haveGlyphs(const char *str)
|
||||
return have;
|
||||
}
|
||||
|
||||
#if defined(USE_EINK) || defined(USE_EPD)
|
||||
#if defined(USE_EINK)
|
||||
/// Used on eink displays while in deep sleep
|
||||
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) {
|
||||
uint32_t delta = millis() - gpsStatus->getLastFixMillis();
|
||||
char uptimeStr[32];
|
||||
#if defined(USE_EINK) || defined(USE_EPD)
|
||||
#if defined(USE_EINK)
|
||||
// E-Ink: skip seconds, show only days/hours/mins
|
||||
getUptimeStr(delta, "Last", uptimeStr, sizeof(uptimeStr), false);
|
||||
#else
|
||||
@@ -1107,7 +1107,7 @@ void UIRenderer::drawCompassAndLocationScreen(OLEDDisplay *display, OLEDDisplayU
|
||||
int yBelowContent = getTextPositions(display)[5] + FONT_HEIGHT_SMALL + 2;
|
||||
const int margin = 4;
|
||||
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
|
||||
#else
|
||||
SCREEN_HEIGHT - yBelowContent - margin;
|
||||
@@ -1250,7 +1250,7 @@ void UIRenderer::drawNavigationBar(OLEDDisplay *display, OLEDDisplayUiState *sta
|
||||
bool navBarVisible = millis() - lastFrameChangeTime <= ICON_DISPLAY_DURATION_MS;
|
||||
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
|
||||
static uint32_t navBarLastShown = 0;
|
||||
static bool cosmeticRefreshDone = false;
|
||||
|
||||
@@ -72,7 +72,7 @@ class UIRenderer
|
||||
static void drawOEMBootScreen(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y);
|
||||
#endif
|
||||
|
||||
#if defined(USE_EINK) || defined(USE_EPD)
|
||||
#if defined(USE_EINK)
|
||||
/// Used on eink displays while in deep sleep
|
||||
static void drawDeepSleepFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y);
|
||||
|
||||
|
||||
10
src/main.cpp
10
src/main.cpp
@@ -888,7 +888,7 @@ void setup()
|
||||
|
||||
#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(USE_ST7796) || defined(USE_SPISSD1306) || defined(USE_EPD)
|
||||
defined(USE_ST7796) || defined(USE_SPISSD1306)
|
||||
screen = new graphics::Screen(screen_found, screen_model, screen_geometry);
|
||||
#elif defined(ARCH_PORTDUINO)
|
||||
if ((screen_found.port != ScanI2C::I2CPort::NO_I2C || portduino_config.displayPanel) &&
|
||||
@@ -1143,12 +1143,6 @@ void setup()
|
||||
|
||||
#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
|
||||
// After modules are setup, so we can observe modules
|
||||
setupNicheGraphics();
|
||||
@@ -1171,7 +1165,7 @@ void setup()
|
||||
// the current region name)
|
||||
#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(USE_ST7796) || defined(USE_SPISSD1306) || defined(USE_EPD)
|
||||
defined(USE_ST7796) || defined(USE_SPISSD1306)
|
||||
if (screen)
|
||||
screen->setup();
|
||||
#elif defined(ARCH_PORTDUINO)
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
#ifdef T5_S3_EPAPER_PRO
|
||||
|
||||
#include "SPILock.h"
|
||||
#include "TouchDrvGT911.hpp"
|
||||
#include "Wire.h"
|
||||
#include "input/TouchScreenImpl1.h"
|
||||
@@ -12,10 +11,9 @@ TouchDrvGT911 touch;
|
||||
bool readTouch(int16_t *x, int16_t *y)
|
||||
{
|
||||
if (!digitalRead(GT911_PIN_INT)) {
|
||||
concurrency::LockGuard g(spiLock);
|
||||
int16_t raw_x;
|
||||
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
|
||||
*x = raw_y;
|
||||
*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
|
||||
void lateInitVariant_T5S3Pro(void)
|
||||
void lateInitVariant(void)
|
||||
{
|
||||
concurrency::LockGuard g(spiLock);
|
||||
touch.setPins(GT911_PIN_RST, GT911_PIN_INT);
|
||||
if (touch.begin(Wire, GT911_SLAVE_ADDRESS_L, GT911_PIN_SDA, GT911_PIN_SCL)) {
|
||||
touchScreenImpl1 = new TouchScreenImpl1(EPD_WIDTH, EPD_HEIGHT, readTouch);
|
||||
|
||||
@@ -8,15 +8,15 @@ build_flags = -fno-strict-aliasing
|
||||
${esp32_base.build_flags}
|
||||
-I variants/esp32s3/t5s3_epaper
|
||||
-D T5_S3_EPAPER_PRO
|
||||
-D USE_EINK
|
||||
-D USE_EINK_PARALLELDISPLAY
|
||||
-D PRIVATE_HW
|
||||
-D TOUCH_THRESHOLD_X=60
|
||||
-D TOUCH_THRESHOLD_Y=40
|
||||
-D TIME_LONG_PRESS=500
|
||||
-D CONFIG_DISABLE_HAL_LOCKS=1 ; we use SPILock instead
|
||||
; -D EINK_LIMIT_GHOSTING_PX=5000
|
||||
-D EPD_FULLSLOW_PERIOD=100
|
||||
-D FAST_EPD_PARTIAL_UPDATE_BUG
|
||||
; -D GPS_POWER_TOGGLE
|
||||
-D FAST_EPD_PARTIAL_UPDATE_BUG ; use rect area update instead of partial
|
||||
|
||||
build_src_filter =
|
||||
${esp32s3_base.build_src_filter}
|
||||
@@ -55,3 +55,4 @@ build_flags =
|
||||
${t5s3_epaper_base.build_flags}
|
||||
-D T5_S3_EPAPER_PRO_V2
|
||||
-D SDCARD_USE_SPI1
|
||||
-D GPS_POWER_TOGGLE
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
|
||||
// Display (E-Ink) ED047TC1 - 8bit parallel
|
||||
#define USE_EPD
|
||||
#define EPD_WIDTH 960
|
||||
#define EPD_HEIGHT 540
|
||||
|
||||
|
||||
Reference in New Issue
Block a user