mirror of
https://github.com/lumapu/ahoy.git
synced 2025-07-28 21:57:11 +02:00
reduce update cycle of ePaper from 5 to 10 seconds
... and fix calls to mEpaper.fullRefresh() and mEpaper.tickerSecond() if no ePaper is configured
This commit is contained in:
parent
3c0c8eece3
commit
440d7748b9
1 changed files with 22 additions and 11 deletions
|
@ -79,16 +79,25 @@ class Display {
|
||||||
void tickerSecond() {
|
void tickerSecond() {
|
||||||
bool request_refresh = false;
|
bool request_refresh = false;
|
||||||
|
|
||||||
if (mMono != NULL)
|
if (mMono != NULL) {
|
||||||
|
// maintain LCD and OLED displays with pixel shift screensavers, at least every 5 seconds
|
||||||
request_refresh = mMono->loop(motionSensorActive());
|
request_refresh = mMono->loop(motionSensorActive());
|
||||||
|
if (mNewPayload || (((++mLoopCnt) % 5) == 0) || request_refresh) {
|
||||||
if (mNewPayload || (((++mLoopCnt) % 5) == 0) || request_refresh) {
|
DataScreen();
|
||||||
DataScreen();
|
mNewPayload = false;
|
||||||
mNewPayload = false;
|
mLoopCnt = 0;
|
||||||
mLoopCnt = 0;
|
}
|
||||||
}
|
}
|
||||||
#if defined(ESP32) && !defined(ETHERNET)
|
#if defined(ESP32) && !defined(ETHERNET)
|
||||||
|
else if (DISP_TYPE_T10_EPAPER == mCfg->type) {
|
||||||
|
// maintain ePaper at least every 10 seconds
|
||||||
|
if (mNewPayload || (((++mLoopCnt) % 10) == 0)) {
|
||||||
|
DataScreen();
|
||||||
|
mNewPayload = false;
|
||||||
|
mLoopCnt = 0;
|
||||||
|
}
|
||||||
mEpaper.tickerSecond();
|
mEpaper.tickerSecond();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -180,12 +189,14 @@ class Display {
|
||||||
else if (DISP_TYPE_T10_EPAPER == mCfg->type) {
|
else if (DISP_TYPE_T10_EPAPER == mCfg->type) {
|
||||||
mEpaper.loop((totalPower), totalYieldDay, totalYieldTotal, nrprod);
|
mEpaper.loop((totalPower), totalYieldDay, totalYieldTotal, nrprod);
|
||||||
mRefreshCycle++;
|
mRefreshCycle++;
|
||||||
|
|
||||||
|
if (mRefreshCycle > 480) {
|
||||||
|
mEpaper.fullRefresh();
|
||||||
|
mRefreshCycle = 0;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mRefreshCycle > 480) {
|
|
||||||
mEpaper.fullRefresh();
|
|
||||||
mRefreshCycle = 0;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue