add daylight saving

This commit is contained in:
sharandac
2020-07-21 01:55:03 +02:00
parent 1221662cc0
commit 9bd9c4b013
7 changed files with 57 additions and 21 deletions

View File

@@ -107,10 +107,9 @@ void pmu_loop( TTGOClass *ttgo ) {
uint32_t pmu_get_byttery_percent( TTGOClass *ttgo ) {
// discharg coulumb higher then charge coulumb, battery state unknow and set to zero
if ( ttgo->power->getBattChargeCoulomb() < ttgo->power->getBattDischargeCoulomb() )
if ( ttgo->power->getBattChargeCoulomb() < ttgo->power->getBattDischargeCoulomb() ) {
ttgo->power->ClearCoulombcounter();
// printf("Coulumb data: %0.1fmAh %0.1f%% (charge current: %0.1fmA, discharge current: %0.1fmA)\r",ttgo->power->getCoulombData(), (ttgo->power->getCoulombData()/380)*100, ttgo->power->getBattChargeCurrent(), ttgo->power->getBattDischargeCurrent() );
return( -1 );
}
return( ( ttgo->power->getCoulombData() / PMU_BATTERY_CAP ) * 100 );
}