when the AXP192 is present, also display battery voltage and current.
this will give a good estimate on the current battery state.
This commit is contained in:
parent
29533fa70e
commit
7a9dbb3b1f
@ -39,8 +39,14 @@ void _screen_header() {
|
|||||||
display->setTextAlignment(TEXT_ALIGN_LEFT);
|
display->setTextAlignment(TEXT_ALIGN_LEFT);
|
||||||
display->drawString(0, 2, buffer);
|
display->drawString(0, 2, buffer);
|
||||||
|
|
||||||
// Datetime
|
// Datetime (if the axp192 PMIC is present, alternate between powerstats and time)
|
||||||
gps_time(buffer, sizeof(buffer));
|
if(axp192_found && millis()%8000 < 3000){
|
||||||
|
snprintf(buffer, sizeof(buffer), "%.1fV %.0fmA", axp.getBattVoltage()/1000, axp.getBattChargeCurrent() - axp.getBattDischargeCurrent());
|
||||||
|
|
||||||
|
} else {
|
||||||
|
gps_time(buffer, sizeof(buffer));
|
||||||
|
}
|
||||||
|
|
||||||
display->setTextAlignment(TEXT_ALIGN_CENTER);
|
display->setTextAlignment(TEXT_ALIGN_CENTER);
|
||||||
display->drawString(display->getWidth()/2, 2, buffer);
|
display->drawString(display->getWidth()/2, 2, buffer);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user