From e27de07af15b84e585e2b4b8459276b5ebc95aaf Mon Sep 17 00:00:00 2001 From: norbert-walter Date: Fri, 16 Aug 2024 17:18:34 +0200 Subject: [PATCH] Test program for OBP60 with modyfied display update (slow and duble update ) --- lib/obp60task/OBP60Extensions.cpp | 2 +- lib/obp60task/OBP60Extensions.h | 2 +- lib/obp60task/OBP60Hardware.h | 1 + lib/obp60task/PageVoltage.cpp | 3 ++- lib/obp60task/PageWindRose.cpp | 4 +++- lib/obp60task/obp60task.cpp | 34 ++++++++++++++++++++----------- lib/obp60task/platformio.ini | 2 +- 7 files changed, 31 insertions(+), 17 deletions(-) diff --git a/lib/obp60task/OBP60Extensions.cpp b/lib/obp60task/OBP60Extensions.cpp index 6f78948..b4dd5d6 100644 --- a/lib/obp60task/OBP60Extensions.cpp +++ b/lib/obp60task/OBP60Extensions.cpp @@ -40,7 +40,7 @@ GxEPD2_BW display(GxEPD2_4 GxEPD2_BW & getdisplay(){return display;} #endif -#ifdef DISPLAY_GYE042A8 +#ifdef DISPLAY_GYE042A87 // Set display type and SPI pins for display GxEPD2_BW display(GxEPD2_420_GYE042A87(OBP_SPI_CS, OBP_SPI_DC, OBP_SPI_RST, OBP_SPI_BUSY)); // GDEW042T2 400x300, UC8176 (IL0398) // Export display in new funktion diff --git a/lib/obp60task/OBP60Extensions.h b/lib/obp60task/OBP60Extensions.h index 79e0b52..5f25564 100644 --- a/lib/obp60task/OBP60Extensions.h +++ b/lib/obp60task/OBP60Extensions.h @@ -27,7 +27,7 @@ GxEPD2_BW & getdisplay(); GxEPD2_BW & getdisplay(); #endif -#ifdef DISPLAY_GYE042A8 +#ifdef DISPLAY_GYE042A87 GxEPD2_BW & getdisplay(); #endif diff --git a/lib/obp60task/OBP60Hardware.h b/lib/obp60task/OBP60Hardware.h index 5219ded..ace84d2 100644 --- a/lib/obp60task/OBP60Hardware.h +++ b/lib/obp60task/OBP60Hardware.h @@ -38,6 +38,7 @@ #define OBP_SPI_CLK 38 #define OBP_SPI_DIN 48 #define SHOW_TIME 6000 // Show time in [ms] for logo and WiFi QR code + #define FAST_FULL_UPDATE false// Enable fast full update for e-paper display GDEY042T81 #define FULL_REFRESH_TIME 600 // Refresh cycle time in [s][600...3600] for full display update (very important healcy function) #define MAX_PAGE_NUMBER 10 // Max number of pages for show data #define FONT1 "Ubuntu_Bold8pt7b" diff --git a/lib/obp60task/PageVoltage.cpp b/lib/obp60task/PageVoltage.cpp index 36cba5b..71f3d02 100644 --- a/lib/obp60task/PageVoltage.cpp +++ b/lib/obp60task/PageVoltage.cpp @@ -262,7 +262,8 @@ public: } // Update display - getdisplay().nextPage(); // Partial update (fast) + while(getdisplay().nextPage()); // Partial update (fast) + while(getdisplay().nextPage()); // Partial update (fast) }; }; diff --git a/lib/obp60task/PageWindRose.cpp b/lib/obp60task/PageWindRose.cpp index df546f5..1d57617 100644 --- a/lib/obp60task/PageWindRose.cpp +++ b/lib/obp60task/PageWindRose.cpp @@ -387,7 +387,9 @@ public: } // Update display - getdisplay().nextPage(); // Partial update (fast) + while(getdisplay().nextPage()); // Partial update (fast) + while(getdisplay().nextPage()); // Partial update (fast) + while(getdisplay().nextPage()); // Partial update (fast) }; }; diff --git a/lib/obp60task/obp60task.cpp b/lib/obp60task/obp60task.cpp index 8b5cca8..7bea511 100644 --- a/lib/obp60task/obp60task.cpp +++ b/lib/obp60task/obp60task.cpp @@ -46,8 +46,13 @@ void OBP60Init(GwApi *api){ // Init hardware hardwareInit(); - // static const bool useFastFullUpdate = true; // For high speed full update e-paper - static const bool useFastFullUpdate = false; // For normal speed full update e-paper + + #ifdef DISPLAY_GDEY042T81 + if(FAST_FULL_UPDATE == true){ + static const bool useFastFullUpdate = true; // Enable fast full display update only for GDEY042T81 + } + #endif + /* setCpuFrequencyMhz(80); int freq = getCpuFrequencyMhz(); @@ -535,9 +540,11 @@ void OBP60Task(GwApi *api){ // Full display update afer a new selected page and 4s wait time if(millis() > starttime4 + 4000 && delayedDisplayUpdate == true){ getdisplay().setFullWindow(); // Set full update - getdisplay().fillScreen(pixelcolor);// Clear display - getdisplay().nextPage(); // Full update - getdisplay().fillScreen(bgcolor);// Clear display + if(FAST_FULL_UPDATE == false){ + getdisplay().fillScreen(pixelcolor);// Clear display + getdisplay().nextPage(); // Full update + getdisplay().fillScreen(bgcolor); // Clear display + } getdisplay().nextPage(); // Full update delayedDisplayUpdate = false; } @@ -548,9 +555,11 @@ void OBP60Task(GwApi *api){ starttime1 = millis(); LOG_DEBUG(GwLog::DEBUG,"E-Ink full refresh first 5 min"); getdisplay().setFullWindow(); // Set full update - getdisplay().fillScreen(pixelcolor);// Clear display - getdisplay().nextPage(); // Full update - getdisplay().fillScreen(bgcolor);// Clear display + if(FAST_FULL_UPDATE == false){ + getdisplay().fillScreen(pixelcolor);// Clear display + getdisplay().nextPage(); // Full update + getdisplay().fillScreen(bgcolor); // Clear display + } getdisplay().nextPage(); // Full update } @@ -560,10 +569,11 @@ void OBP60Task(GwApi *api){ starttime2 = millis(); LOG_DEBUG(GwLog::DEBUG,"E-Ink full refresh"); getdisplay().setFullWindow(); // Set full update - getdisplay().setFullWindow(); // Set full update - getdisplay().fillScreen(pixelcolor);// Clear display - getdisplay().nextPage(); // Full update - getdisplay().fillScreen(bgcolor);// Clear display + if(FAST_FULL_UPDATE == false){ + getdisplay().fillScreen(pixelcolor);// Clear display + getdisplay().nextPage(); // Full update + getdisplay().fillScreen(bgcolor); // Clear display + } getdisplay().nextPage(); // Full update } diff --git a/lib/obp60task/platformio.ini b/lib/obp60task/platformio.ini index deb670e..f8d5155 100644 --- a/lib/obp60task/platformio.ini +++ b/lib/obp60task/platformio.ini @@ -42,7 +42,7 @@ build_flags= -D BOARD_OBP60S3 # -D DISPLAY_GDEW042T2 #old E-Ink display from Waveshare, R10 0.47 ohm -D DISPLAY_GDEY042T81 #new E-Ink display from Waveshare, R10 2.2 ohm -# -D DISPLAY_GYE042A8 #alternativ E-Ink display from Genyo Optical, R10 2.2 ohm +# -D DISPLAY_GYE042A87 #alternativ E-Ink display from Genyo Optical, R10 2.2 ohm # -D DISPLAY_SE0420NQ04 #alternativ E-Ink display from SID Technology, R10 2.2 ohm ${env.build_flags} #CONFIG_ESP_TASK_WDT_TIMEOUT_S = 10 #Task Watchdog timeout period (seconds) [1...60] 5 default