mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-08 14:12:05 +00:00
E-ink partial refresh limitation removed for free text screen (#6201)
This commit is contained in:
parent
64b9cfe199
commit
2525111c39
@ -324,6 +324,14 @@ void EInkDynamicDisplay::checkConsecutiveFastRefreshes()
|
|||||||
if (refresh != UNSPECIFIED)
|
if (refresh != UNSPECIFIED)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// Bypass limit if UNLIMITED_FAST mode is active
|
||||||
|
if (frameFlags & UNLIMITED_FAST) {
|
||||||
|
refresh = FAST;
|
||||||
|
reason = NO_OBJECTIONS;
|
||||||
|
LOG_DEBUG("refresh=FAST, reason=UNLIMITED_FAST_MODE_ACTIVE, frameFlags=0x%x", frameFlags);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// If too many FAST refreshes consecutively - force a FULL refresh
|
// If too many FAST refreshes consecutively - force a FULL refresh
|
||||||
if (fastRefreshCount >= EINK_LIMIT_FASTREFRESH) {
|
if (fastRefreshCount >= EINK_LIMIT_FASTREFRESH) {
|
||||||
refresh = FULL;
|
refresh = FULL;
|
||||||
|
@ -23,6 +23,10 @@ class EInkDynamicDisplay : public EInkDisplay, protected concurrency::NotifiedWo
|
|||||||
EInkDynamicDisplay(uint8_t address, int sda, int scl, OLEDDISPLAY_GEOMETRY geometry, HW_I2C i2cBus);
|
EInkDynamicDisplay(uint8_t address, int sda, int scl, OLEDDISPLAY_GEOMETRY geometry, HW_I2C i2cBus);
|
||||||
~EInkDynamicDisplay();
|
~EInkDynamicDisplay();
|
||||||
|
|
||||||
|
// Methods to enable or disable unlimited fast refresh mode
|
||||||
|
void enableUnlimitedFastMode() { addFrameFlag(UNLIMITED_FAST); }
|
||||||
|
void disableUnlimitedFastMode() { frameFlags = (frameFlagTypes)(frameFlags & ~UNLIMITED_FAST); }
|
||||||
|
|
||||||
// What kind of frame is this
|
// What kind of frame is this
|
||||||
enum frameFlagTypes : uint8_t {
|
enum frameFlagTypes : uint8_t {
|
||||||
BACKGROUND = (1 << 0), // For frames via display()
|
BACKGROUND = (1 << 0), // For frames via display()
|
||||||
@ -30,6 +34,7 @@ class EInkDynamicDisplay : public EInkDisplay, protected concurrency::NotifiedWo
|
|||||||
COSMETIC = (1 << 2), // For splashes
|
COSMETIC = (1 << 2), // For splashes
|
||||||
DEMAND_FAST = (1 << 3), // Special case only
|
DEMAND_FAST = (1 << 3), // Special case only
|
||||||
BLOCKING = (1 << 4), // Modifier - block while refresh runs
|
BLOCKING = (1 << 4), // Modifier - block while refresh runs
|
||||||
|
UNLIMITED_FAST = (1 << 5)
|
||||||
};
|
};
|
||||||
void addFrameFlag(frameFlagTypes flag);
|
void addFrameFlag(frameFlagTypes flag);
|
||||||
|
|
||||||
|
@ -1057,6 +1057,11 @@ void CannedMessageModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *st
|
|||||||
display->drawString(10 + x, 0 + y + FONT_HEIGHT_SMALL, "Canned Message\nModule disabled.");
|
display->drawString(10 + x, 0 + y + FONT_HEIGHT_SMALL, "Canned Message\nModule disabled.");
|
||||||
} else if (cannedMessageModule->runState == CANNED_MESSAGE_RUN_STATE_FREETEXT) {
|
} else if (cannedMessageModule->runState == CANNED_MESSAGE_RUN_STATE_FREETEXT) {
|
||||||
requestFocus(); // Tell Screen::setFrames to move to our module's frame
|
requestFocus(); // Tell Screen::setFrames to move to our module's frame
|
||||||
|
#if defined(USE_EINK) && defined(USE_EINK_DYNAMICDISPLAY)
|
||||||
|
EInkDynamicDisplay* einkDisplay = static_cast<EInkDynamicDisplay*>(display);
|
||||||
|
einkDisplay->enableUnlimitedFastMode(); // Enable unlimited fast refresh while typing
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(USE_VIRTUAL_KEYBOARD)
|
#if defined(USE_VIRTUAL_KEYBOARD)
|
||||||
drawKeyboard(display, state, 0, 0);
|
drawKeyboard(display, state, 0, 0);
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user