Closed AlexanderTonn closed 1 year ago
+ uint16_t uiPageRefreshTime = 1000; //Target time (ms) for refreshing Page screens
- bool x1 = false; - x1 = functionTrigger(uiMyMillis,1000); + bool x1 = functionTrigger(uiMyMillis,uiPageRefreshTime ); - if(x1) - showValues(PAGE_MAIN, byModeActual); if(x1 && byPageId == PAGE_MAIN) + { showMainscreen(byModeActual, byModeOld); + showValues(PAGE_MAIN, byModeActual); + }
- bool functionTrigger(uint64_t &uiMillisOld, uint64_t uiTargetTime); + auto functionTrigger(uint64_t &uiMillisOld, uint16_t uiTargetTime) -> bool;
auto functionTrigger(uint64_t &uiMillisOld, uint16_t uiTargetTime) -> bool { uint64_t uiMillisActual = 0; myMillis(uiMillisActual);
if (uiMillisActual - uiMillisOld >= uiTargetTime) { myMillis(uiMillisOld); return true; } else { return false; }
}
# Screenshots
Since the last commit, the HMI lines in "voidLoop" are moved to hmi.ino in a separate function for looping hmi functions
Describe the changes
New Variables
in void loop()
in util.h
in util.ino
auto functionTrigger(uint64_t &uiMillisOld, uint16_t uiTargetTime) -> bool { uint64_t uiMillisActual = 0; myMillis(uiMillisActual);
if (uiMillisActual - uiMillisOld >= uiTargetTime) { myMillis(uiMillisOld); return true; } else { return false; }
}