mirror of
https://github.com/lumapu/ahoy.git
synced 2025-06-07 05:01:39 +02:00
bug fixes
This commit is contained in:
parent
e2f8fcab40
commit
b12effd59e
1 changed files with 70 additions and 64 deletions
|
@ -165,6 +165,11 @@ void DisplayEPaper::actualPowerPaged(float totalPower, float totalYieldDay, floa
|
||||||
} else {
|
} else {
|
||||||
snprintf(_fmtText, sizeof(_fmtText), "offline");
|
snprintf(_fmtText, sizeof(_fmtText), "offline");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((totalPower == 0) && (mEnPowerSafe)) {
|
||||||
|
_display->fillRect(0, mHeadFootPadding, 200, 200, GxEPD_BLACK);
|
||||||
|
_display->drawBitmap(0, 0, logo, 200, 200, GxEPD_WHITE);
|
||||||
|
} else {
|
||||||
_display->getTextBounds(_fmtText, 0, 0, &tbx, &tby, &tbw, &tbh);
|
_display->getTextBounds(_fmtText, 0, 0, &tbx, &tby, &tbw, &tbh);
|
||||||
x = ((_display->width() - tbw) / 2) - tbx;
|
x = ((_display->width() - tbw) / 2) - tbx;
|
||||||
_display->setCursor(x, mHeadFootPadding + tbh + 10);
|
_display->setCursor(x, mHeadFootPadding + tbh + 10);
|
||||||
|
@ -234,6 +239,7 @@ void DisplayEPaper::actualPowerPaged(float totalPower, float totalYieldDay, floa
|
||||||
x = ((_display->width() - tbw - 20) / 2) - tbx;
|
x = ((_display->width() - tbw - 20) / 2) - tbx;
|
||||||
_display->setCursor(x, y);
|
_display->setCursor(x, y);
|
||||||
_display->println(_fmtText);
|
_display->println(_fmtText);
|
||||||
|
}
|
||||||
} while (_display->nextPage());
|
} while (_display->nextPage());
|
||||||
}
|
}
|
||||||
//***************************************************************************
|
//***************************************************************************
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue