Skip to content

Commit

Permalink
Test program for OBP60 with modyfied display update (slow and duble u…
Browse files Browse the repository at this point in the history
…pdate )
  • Loading branch information
norbert-walter committed Aug 16, 2024
1 parent ff02bfe commit e27de07
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 17 deletions.
2 changes: 1 addition & 1 deletion lib/obp60task/OBP60Extensions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ GxEPD2_BW<GxEPD2_420_GDEY042T81, GxEPD2_420_GDEY042T81::HEIGHT> display(GxEPD2_4
GxEPD2_BW<GxEPD2_420_GDEY042T81, GxEPD2_420_GDEY042T81::HEIGHT> & getdisplay(){return display;}
#endif

#ifdef DISPLAY_GYE042A8
#ifdef DISPLAY_GYE042A87
// Set display type and SPI pins for display
GxEPD2_BW<GxEPD2_420_GYE042A87, GxEPD2_420_GYE042A87::HEIGHT> 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
Expand Down
2 changes: 1 addition & 1 deletion lib/obp60task/OBP60Extensions.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ GxEPD2_BW<GxEPD2_420, GxEPD2_420::HEIGHT> & getdisplay();
GxEPD2_BW<GxEPD2_420_GDEY042T81, GxEPD2_420_GDEY042T81::HEIGHT> & getdisplay();
#endif

#ifdef DISPLAY_GYE042A8
#ifdef DISPLAY_GYE042A87
GxEPD2_BW<GxEPD2_420_GYE042A87, GxEPD2_420_GYE042A87::HEIGHT> & getdisplay();
#endif

Expand Down
1 change: 1 addition & 0 deletions lib/obp60task/OBP60Hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion lib/obp60task/PageVoltage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ double raw = 0;
}

// Update display
getdisplay().nextPage(); // Partial update (fast)
while(getdisplay().nextPage()); // Partial update (fast)
while(getdisplay().nextPage()); // Partial update (fast)
};
};

Expand Down
4 changes: 3 additions & 1 deletion lib/obp60task/PageWindRose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,9 @@ int16_t lp = 80; // Pointer length
}

// 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)
};
};

Expand Down
34 changes: 22 additions & 12 deletions lib/obp60task/obp60task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
}
Expand All @@ -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
}

Expand All @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion lib/obp60task/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e27de07

Please sign in to comment.