Skip to content

Commit

Permalink
Test firmware 2 with new parameter for e-paper display
Browse files Browse the repository at this point in the history
  • Loading branch information
norbert-walter committed Sep 3, 2024
1 parent 619a20e commit 6829e8b
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 8 deletions.
1 change: 0 additions & 1 deletion lib/obp60task/OBP60Hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#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
27 changes: 26 additions & 1 deletion lib/obp60task/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,32 @@
"label": "Refresh",
"type": "boolean",
"default": "true",
"description": "Refresh E-Ink display after each new page request to reduce ghost effects [on|off]",
"description": "Refresh e-paper display after each new page request to reduce ghost effects [on|off]",
"category": "OBP60 Display",
"capabilities": {
"obp60":"true"
}
},
{
"name": "fastRefresh",
"label": "Fast Refresh",
"type": "boolean",
"default": "true",
"description": "Fast refresh for e-paper display [on|off]",
"category": "OBP60 Display",
"capabilities": {
"obp60":"true"
}
},
{
"name": "fullRefreshTime",
"label": "Full Refresh Time [min]",
"type": "number",
"default": "10",
"check": "checkMinMax",
"min": 1,
"max": 10,
"description": "E-Paper full refresh time all [1...10 min]",
"category": "OBP60 Display",
"capabilities": {
"obp60":"true"
Expand Down
16 changes: 10 additions & 6 deletions lib/obp60task/obp60task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@ void OBP60Init(GwApi *api){
// Init hardware
hardwareInit();

// Settings for e-paper display
String fastrefresh = api->getConfig()->getConfigItem(api->getConfig()->fastRefresh,true)->asString();
api->getLogger()->logDebug(GwLog::DEBUG,"Fast Refresh Mode is: %s", fastrefresh);
#ifdef DISPLAY_GDEY042T81
if(FAST_FULL_UPDATE == true){
if(fastrefresh == "On"){
static const bool useFastFullUpdate = true; // Enable fast full display update only for GDEY042T81
}
#endif
Expand Down Expand Up @@ -296,6 +299,8 @@ void OBP60Task(GwApi *api){
String systemname = api->getConfig()->getConfigItem(api->getConfig()->systemName,true)->asString();
String wifipass = api->getConfig()->getConfigItem(api->getConfig()->apPassword,true)->asString();
bool refreshmode = api->getConfig()->getConfigItem(api->getConfig()->refresh,true)->asBoolean();
String fastrefresh = api->getConfig()->getConfigItem(api->getConfig()->fastRefresh,true)->asString();
uint fullrefreshtime = uint(api->getConfig()->getConfigItem(api->getConfig()->fullRefreshTime,true)->asInt());
int textcolor = GxEPD_BLACK;
int pixelcolor = GxEPD_BLACK;
int bgcolor = GxEPD_WHITE;
Expand Down Expand Up @@ -542,7 +547,7 @@ void OBP60Task(GwApi *api){
starttime1 = millis();
starttime2 = millis();
getdisplay().setFullWindow(); // Set full update
if(FAST_FULL_UPDATE == false){
if(fastrefresh == "Off"){
getdisplay().fillScreen(pixelcolor);// Clear display
getdisplay().nextPage(); // Full update
getdisplay().fillScreen(bgcolor); // Clear display
Expand All @@ -558,7 +563,7 @@ void OBP60Task(GwApi *api){
starttime2 = millis();
LOG_DEBUG(GwLog::DEBUG,"E-Ink full refresh first 5 min");
getdisplay().setFullWindow(); // Set full update
if(FAST_FULL_UPDATE == false){
if(fastrefresh == "Off"){
getdisplay().fillScreen(pixelcolor);// Clear display
getdisplay().nextPage(); // Full update
getdisplay().fillScreen(bgcolor); // Clear display
Expand All @@ -567,12 +572,11 @@ void OBP60Task(GwApi *api){
}

// Subtask E-Ink full refresh
//if(millis() > starttime2 + FULL_REFRESH_TIME * 1000){
if(millis() > starttime2 + 1 * 60 * 1000){
if(millis() > starttime2 + fullrefreshtime * 60 * 1000){
starttime2 = millis();
LOG_DEBUG(GwLog::DEBUG,"E-Ink full refresh");
getdisplay().setFullWindow(); // Set full update
if(FAST_FULL_UPDATE == false){
if(fastrefresh == "Off"){
getdisplay().fillScreen(pixelcolor);// Clear display
getdisplay().nextPage(); // Full update
getdisplay().fillScreen(bgcolor); // Clear display
Expand Down

0 comments on commit 6829e8b

Please sign in to comment.