mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-07-26 23:08:11 +00:00
feat(eink): full refresh interval setting in Settings › Display
Add "Full rfsh" setting (e-ink only) with options off/5/10/20/30 partial refreshes between full refreshes. Prevents ghosting on panels that accumulate artifacts after many partial updates. GxEPDDisplay counts partial refreshes and calls display.display(false) every N frames when the interval is set. Persisted in DataStore and applied at startup via applyFullRefreshInterval(). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -228,5 +228,6 @@ public:
|
||||
|
||||
virtual void setBrightness(uint8_t level) { } // level 0-4 (min to max), no-op default
|
||||
virtual void setDisplayRotation(uint8_t rot) { } // 0-3, no-op for fixed-orientation displays
|
||||
virtual void setFullRefreshInterval(uint8_t n) { } // e-ink: do full refresh every n partial refreshes (0=never)
|
||||
virtual void endFrame() = 0;
|
||||
};
|
||||
|
||||
@@ -195,7 +195,12 @@ void GxEPDDisplay::setDisplayRotation(uint8_t rot) {
|
||||
void GxEPDDisplay::endFrame() {
|
||||
uint32_t crc = display_crc.finalize();
|
||||
if (crc != last_display_crc_value) {
|
||||
display.display(true);
|
||||
bool partial = true;
|
||||
if (_full_refresh_interval > 0 && ++_partial_count >= _full_refresh_interval) {
|
||||
partial = false;
|
||||
_partial_count = 0;
|
||||
}
|
||||
display.display(partial);
|
||||
last_display_crc_value = crc;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,6 +54,8 @@ class GxEPDDisplay : public DisplayDriver {
|
||||
CRC32 display_crc;
|
||||
int last_display_crc_value = 0;
|
||||
int _text_sz = 1;
|
||||
uint8_t _full_refresh_interval = 0; // 0=never, N=full refresh every N partial refreshes
|
||||
uint8_t _partial_count = 0;
|
||||
|
||||
public:
|
||||
#if defined(EINK_DISPLAY_MODEL)
|
||||
@@ -100,5 +102,6 @@ public:
|
||||
void drawXbm(int x, int y, const uint8_t* bits, int w, int h) override;
|
||||
uint16_t getTextWidth(const char* str) override;
|
||||
void setDisplayRotation(uint8_t rot) override;
|
||||
void setFullRefreshInterval(uint8_t n) override { _full_refresh_interval = n; _partial_count = 0; }
|
||||
void endFrame() override;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user