Test firmware 2 with new parameter for e-paper display

This commit is contained in:
norbert-walter 2024-09-03 20:51:30 +02:00
parent 619a20e4c7
commit 6829e8b2ee
3 changed files with 36 additions and 8 deletions

View File

@ -38,7 +38,6 @@
#define OBP_SPI_CLK 38 #define OBP_SPI_CLK 38
#define OBP_SPI_DIN 48 #define OBP_SPI_DIN 48
#define SHOW_TIME 6000 // Show time in [ms] for logo and WiFi QR code #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 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 MAX_PAGE_NUMBER 10 // Max number of pages for show data
#define FONT1 "Ubuntu_Bold8pt7b" #define FONT1 "Ubuntu_Bold8pt7b"

View File

@ -650,7 +650,32 @@
"label": "Refresh", "label": "Refresh",
"type": "boolean", "type": "boolean",
"default": "true", "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", "category": "OBP60 Display",
"capabilities": { "capabilities": {
"obp60":"true" "obp60":"true"

View File

@ -47,8 +47,11 @@ void OBP60Init(GwApi *api){
// Init hardware // Init hardware
hardwareInit(); 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 #ifdef DISPLAY_GDEY042T81
if(FAST_FULL_UPDATE == true){ if(fastrefresh == "On"){
static const bool useFastFullUpdate = true; // Enable fast full display update only for GDEY042T81 static const bool useFastFullUpdate = true; // Enable fast full display update only for GDEY042T81
} }
#endif #endif
@ -296,6 +299,8 @@ void OBP60Task(GwApi *api){
String systemname = api->getConfig()->getConfigItem(api->getConfig()->systemName,true)->asString(); String systemname = api->getConfig()->getConfigItem(api->getConfig()->systemName,true)->asString();
String wifipass = api->getConfig()->getConfigItem(api->getConfig()->apPassword,true)->asString(); String wifipass = api->getConfig()->getConfigItem(api->getConfig()->apPassword,true)->asString();
bool refreshmode = api->getConfig()->getConfigItem(api->getConfig()->refresh,true)->asBoolean(); 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 textcolor = GxEPD_BLACK;
int pixelcolor = GxEPD_BLACK; int pixelcolor = GxEPD_BLACK;
int bgcolor = GxEPD_WHITE; int bgcolor = GxEPD_WHITE;
@ -542,7 +547,7 @@ void OBP60Task(GwApi *api){
starttime1 = millis(); starttime1 = millis();
starttime2 = millis(); starttime2 = millis();
getdisplay().setFullWindow(); // Set full update getdisplay().setFullWindow(); // Set full update
if(FAST_FULL_UPDATE == false){ if(fastrefresh == "Off"){
getdisplay().fillScreen(pixelcolor);// Clear display getdisplay().fillScreen(pixelcolor);// Clear display
getdisplay().nextPage(); // Full update getdisplay().nextPage(); // Full update
getdisplay().fillScreen(bgcolor); // Clear display getdisplay().fillScreen(bgcolor); // Clear display
@ -558,7 +563,7 @@ void OBP60Task(GwApi *api){
starttime2 = millis(); starttime2 = millis();
LOG_DEBUG(GwLog::DEBUG,"E-Ink full refresh first 5 min"); LOG_DEBUG(GwLog::DEBUG,"E-Ink full refresh first 5 min");
getdisplay().setFullWindow(); // Set full update getdisplay().setFullWindow(); // Set full update
if(FAST_FULL_UPDATE == false){ if(fastrefresh == "Off"){
getdisplay().fillScreen(pixelcolor);// Clear display getdisplay().fillScreen(pixelcolor);// Clear display
getdisplay().nextPage(); // Full update getdisplay().nextPage(); // Full update
getdisplay().fillScreen(bgcolor); // Clear display getdisplay().fillScreen(bgcolor); // Clear display
@ -567,12 +572,11 @@ void OBP60Task(GwApi *api){
} }
// Subtask E-Ink full refresh // Subtask E-Ink full refresh
//if(millis() > starttime2 + FULL_REFRESH_TIME * 1000){ if(millis() > starttime2 + fullrefreshtime * 60 * 1000){
if(millis() > starttime2 + 1 * 60 * 1000){
starttime2 = millis(); starttime2 = millis();
LOG_DEBUG(GwLog::DEBUG,"E-Ink full refresh"); LOG_DEBUG(GwLog::DEBUG,"E-Ink full refresh");
getdisplay().setFullWindow(); // Set full update getdisplay().setFullWindow(); // Set full update
if(FAST_FULL_UPDATE == false){ if(fastrefresh == "Off"){
getdisplay().fillScreen(pixelcolor);// Clear display getdisplay().fillScreen(pixelcolor);// Clear display
getdisplay().nextPage(); // Full update getdisplay().nextPage(); // Full update
getdisplay().fillScreen(bgcolor); // Clear display getdisplay().fillScreen(bgcolor); // Clear display