mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2026-08-18 10:22:31 +02:00
Fix for display flicker by display refresh
This commit is contained in:
@@ -826,6 +826,7 @@ void OBP60Task(GwApi *api){
|
||||
if(millis() > starttime3 + pagetime){
|
||||
LOG_DEBUG(GwLog::DEBUG,"Page with refreshtime=%d", pagetime);
|
||||
starttime3 = millis();
|
||||
bool pageChanged = (lastPage != pageNumber);
|
||||
|
||||
//refresh data from api
|
||||
api->getBoatDataValues(boatValues.numValues,boatValues.allBoatValues);
|
||||
@@ -841,6 +842,10 @@ void OBP60Task(GwApi *api){
|
||||
// getdisplay().fillRect(0, 0, getdisplay().width(), getdisplay().height(), commonData.bgcolor);
|
||||
#ifndef DISPLAY_ST7796
|
||||
getdisplay().fillScreen(commonData.bgcolor); // Clear display
|
||||
#else
|
||||
if (pageChanged) {
|
||||
getdisplay().fillScreen(commonData.bgcolor); // Clear display after page switch
|
||||
}
|
||||
#endif
|
||||
|
||||
// Show header if enabled
|
||||
@@ -873,7 +878,7 @@ void OBP60Task(GwApi *api){
|
||||
displayNextPage(); // Partial update (fast)
|
||||
}
|
||||
else{
|
||||
if (lastPage != pageNumber){
|
||||
if (pageChanged){
|
||||
if (lastPage != -1){ // skip cleanup if we are during startup, and no page has been displayed yet.
|
||||
pages[lastPage].page->leavePage(pages[lastPage].parameters); // call page cleanup code
|
||||
if (hasFRAM) fram.write(FRAM_PAGE_NO, pageNumber); // remember new page for device restart
|
||||
|
||||
Reference in New Issue
Block a user