Mercurial > public > ostc4
diff Discovery/Src/t7.c @ 432:2b4440f75434
show battery percent and voltage and surfacemode. That gives additional
information to the user to detect a wrong calibrated battery symbol and
helps debugging issues around charging and battery life
author | heinrichsweikamp |
---|---|
date | Tue, 18 Feb 2020 12:41:45 +0100 |
parents | 73db1565220b |
children | adb18fe92737 |
line wrap: on
line diff
--- a/Discovery/Src/t7.c Tue Feb 18 09:58:52 2020 +0100 +++ b/Discovery/Src/t7.c Tue Feb 18 12:41:45 2020 +0100 @@ -1089,7 +1089,8 @@ GFX_write_string_color(&Batt24,&t7batt,text,0,CLUT_WarningRed); if((stateUsed->lifeData.battery_charge > 0) && (stateUsed->lifeData.battery_charge < 140)) { - snprintf(text,16,"\004\025\f\002%u%%",(uint8_t)stateUsed->lifeData.battery_charge); + // show battery percent and voltage + snprintf(text,16,"\f\002%u%% \f%.1fV",(uint8_t)stateUsed->lifeData.battery_charge,stateUsed->lifeData.battery_voltage); if(warning_count_high_time) text[0] = '\a'; GFX_write_string(&FontT24,&t7voltage,text,0); @@ -1106,7 +1107,8 @@ if((stateUsed->lifeData.battery_charge > 0) && (stateUsed->lifeData.battery_charge < 140)) { - snprintf(text,16,"\f\002%u%%",(uint8_t)stateUsed->lifeData.battery_charge); + // show battery percent and voltage + snprintf(text,16,"\f\002%u%% \f%.1fV",(uint8_t)stateUsed->lifeData.battery_charge,stateUsed->lifeData.battery_voltage); // GFX_write_string(&FontT24,&t7batt,text,0); GFX_write_string(&FontT24,&t7voltage,text,0); }