AlexanderTonn / SolarPowerhouse

Solar balkony power plant, which includes control logic for switching between micro inverter and battery depending on the state of charge. The repository containing any drawings and manuals.
Apache License 2.0
0 stars 0 forks source link

[PERFORMANCE] functionTrigger optimized #12

Closed AlexanderTonn closed 1 year ago

AlexanderTonn commented 1 year ago

Describe the changes

New Variables

+ uint16_t uiPageRefreshTime = 1000; //Target time (ms) for refreshing Page screens

in void loop()

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

in util.h

- bool functionTrigger(uint64_t &uiMillisOld, uint64_t uiTargetTime);
+ auto functionTrigger(uint64_t &uiMillisOld, uint16_t uiTargetTime) -> bool;

in util.ino

}



# Screenshots
AlexanderTonn commented 1 year ago

Since the last commit, the HMI lines in "voidLoop" are moved to hmi.ino in a separate function for looping hmi functions