From 2093e0bf520cdbc76780915084f60b5a43ccfe77 Mon Sep 17 00:00:00 2001 From: Heltec-Aaron-Lee Date: Thu, 10 Apr 2025 17:13:43 +0800 Subject: [PATCH] Optimiz code for refresh border during full update. --- .../niche/Drivers/EInk/LCMEN2R13ECC1.cpp | 45 +++++-------------- .../niche/Drivers/EInk/LCMEN2R13ECC1.h | 1 - 2 files changed, 11 insertions(+), 35 deletions(-) diff --git a/src/graphics/niche/Drivers/EInk/LCMEN2R13ECC1.cpp b/src/graphics/niche/Drivers/EInk/LCMEN2R13ECC1.cpp index 2eabb9856..5e21c00f6 100644 --- a/src/graphics/niche/Drivers/EInk/LCMEN2R13ECC1.cpp +++ b/src/graphics/niche/Drivers/EInk/LCMEN2R13ECC1.cpp @@ -22,11 +22,17 @@ void LCMEN2R13ECC1::configScanning() // the controller IC's OTP memory, when the update procedure begins. void LCMEN2R13ECC1::configWaveform() { - sendCommand(0x3C); // Border waveform: - sendData(0x85); - - sendCommand(0x18); // Temperature sensor: - sendData(0x80); // Use internal temperature sensor to select an appropriate refresh waveform + switch (updateType) { + case FAST: + sendCommand(0x3C); // Border waveform: + sendData(0x85); + break; + + case FULL: + default: + // From OTP memory + break; + } } void LCMEN2R13ECC1::configUpdateSequence() @@ -59,33 +65,4 @@ void LCMEN2R13ECC1::detachFromUpdate() } } -void LCMEN2R13ECC1::update(uint8_t *imageData, UpdateTypes type) -{ - this->updateType = type; - this->buffer = imageData; - - reset(); - - configFullscreen(); - configScanning(); // Virtual, unused by base class - wait(); - - if (updateType == FULL) { - writeNewImage(); - writeOldImage(); - } else { - configVoltages(); // Virtual, unused by base class - configWaveform(); // Virtual, unused by base class - wait(); - writeNewImage(); - } - - configUpdateSequence(); - sendCommand(0x20); // Begin executing the update - - // Let the update run async, on display hardware. Base class will poll completion, then finalize. - // For a blocking update, call await after update - detachFromUpdate(); -} - #endif // MESHTASTIC_INCLUDE_NICHE_GRAPHICS \ No newline at end of file diff --git a/src/graphics/niche/Drivers/EInk/LCMEN2R13ECC1.h b/src/graphics/niche/Drivers/EInk/LCMEN2R13ECC1.h index 2d9727fe6..7b0aed282 100644 --- a/src/graphics/niche/Drivers/EInk/LCMEN2R13ECC1.h +++ b/src/graphics/niche/Drivers/EInk/LCMEN2R13ECC1.h @@ -31,7 +31,6 @@ class LCMEN2R13ECC1 : public SSD16XX LCMEN2R13ECC1() : SSD16XX(width, height, supported, 1) {} // Note: left edge of this display is offset by 1 byte protected: - virtual void update(uint8_t *imageData, UpdateTypes type) override; virtual void configScanning() override; virtual void configWaveform() override; virtual void configUpdateSequence() override;