cleanup (revert modified files)

This commit is contained in:
Manuel
2025-12-08 13:20:47 +01:00
parent cf49b19404
commit 3a18291a0d
9 changed files with 25 additions and 34 deletions

View File

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

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
void Screen::showOverlayBanner(BannerOverlayOptions banner_overlay_options)
{
#if defined(USE_EINK)
#ifdef 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)
#ifdef 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)
#ifdef USE_EINK
EINK_ADD_FRAMEFLAG(dispdev, DEMAND_FAST); // Skip full refresh for all overlay menus
#endif
// Store the message and set the expiration timestamp
@@ -428,7 +428,7 @@ Screen::~Screen()
*/
void Screen::doDeepSleep()
{
#if defined(USE_EINK)
#ifdef 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)
#ifdef USE_EINK
// eInkScreensaver parameter is usually NULL (default argument), default frame used instead
setScreensaverFrames(einkScreensaver);
#endif
@@ -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)
#ifdef 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
@@ -863,7 +863,7 @@ int32_t Screen::runOnce()
showingNormalScreen = false;
NotificationRenderer::pauseBanner = true;
alertFrames[0] = alertFrame;
#if defined(USE_EINK)
#ifdef 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)
#ifdef USE_EINK
/// Determine which screensaver frame to use, then set the FrameCallback
void Screen::setScreensaverFrames(FrameCallback einkScreensaver)
{
@@ -1061,7 +1061,7 @@ void Screen::setFrames(FrameFocus focus)
normalFrames[numframes++] = graphics::MessageRenderer::drawTextMessageFrame;
indicatorIcons.push_back(icon_mail);
#if !defined(USE_EINK)
#ifndef USE_EINK
if (!hiddenFrames.nodelist) {
fsi.positions.nodelist = numframes;
normalFrames[numframes++] = graphics::NodeListRenderer::drawDynamicNodeListScreen;
@@ -1070,7 +1070,7 @@ void Screen::setFrames(FrameFocus focus)
#endif
// Show detailed node views only on E-Ink builds
#if defined(USE_EINK)
#ifdef USE_EINK
if (!hiddenFrames.nodelist_lastheard) {
fsi.positions.nodelist_lastheard = numframes;
normalFrames[numframes++] = graphics::NodeListRenderer::drawLastHeardScreen;
@@ -1257,12 +1257,12 @@ void Screen::setFrameImmediateDraw(FrameCallback *drawFrames)
void Screen::toggleFrameVisibility(const std::string &frameName)
{
#if !defined(USE_EINK)
#ifndef USE_EINK
if (frameName == "nodelist") {
hiddenFrames.nodelist = !hiddenFrames.nodelist;
}
#endif
#if defined(USE_EINK)
#ifdef USE_EINK
if (frameName == "nodelist_lastheard") {
hiddenFrames.nodelist_lastheard = !hiddenFrames.nodelist_lastheard;
}
@@ -1297,11 +1297,11 @@ void Screen::toggleFrameVisibility(const std::string &frameName)
bool Screen::isFrameHidden(const std::string &frameName) const
{
#if !defined(USE_EINK)
#ifndef USE_EINK
if (frameName == "nodelist")
return hiddenFrames.nodelist;
#endif
#if defined(USE_EINK)
#ifdef ed(USE_EINK)
if (frameName == "nodelist_lastheard")
return hiddenFrames.nodelist_lastheard;
if (frameName == "nodelist_hopsignal")
@@ -1627,8 +1627,7 @@ int Screen::handleInputEvent(const InputEvent *event)
return 0;
}
#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.
#ifdef 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
handleSetOn(true); // Ensure power-on to receive deep-sleep screensaver (PowerFSM should handle?)

View File

@@ -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)
#ifdef 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)
#ifdef USE_EINK
bool nodelist_lastheard = false;
bool nodelist_hopsignal = false;
bool nodelist_distance = false;

View File

@@ -80,14 +80,10 @@
#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 0 // defined(M5STACK_UNITC6L)
#elif 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(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
#else
#define FONT_SMALL FONT_SMALL_LOCAL // Height: 13
#define FONT_MEDIUM FONT_MEDIUM_LOCAL // Height: 19

View File

@@ -1491,11 +1491,11 @@ void menuHandler::FrameToggles_menu()
// Track last selected index (not enum value!)
static int lastSelectedIndex = 0;
#if !defined(USE_EINK)
#ifndef USE_EINK
optionsArray[options] = screen->isFrameHidden("nodelist") ? "Show Node List" : "Hide Node List";
optionsEnumArray[options++] = nodelist;
#endif
#if defined(USE_EINK)
#ifdef 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";

View File

@@ -549,7 +549,7 @@ void drawDynamicNodeListScreen(OLEDDisplay *display, OLEDDisplayUiState *state,
}
#endif
#if defined(USE_EINK)
#ifdef 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)
#ifdef USE_EINK
const char *title = "Hops/Sig";
#else

View File

@@ -836,7 +836,7 @@ bool UIRenderer::haveGlyphs(const char *str)
return have;
}
#if defined(USE_EINK)
#ifdef USE_EINK
/// Used on eink displays while in deep sleep
void UIRenderer::drawDeepSleepFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
{

View File

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

View File

@@ -163,10 +163,6 @@ void setupNicheGraphics();
SPIClass SPI1(HSPI);
#endif
#ifdef T5_S3_EPAPER_PRO
extern void lateInitVariant_T5S3Pro(void);
#endif
using namespace concurrency;
volatile static const char slipstreamTZString[] = {USERPREFS_TZ_STRING};