changeset 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 49c3c5f0d0cb
children aa286a4926c2 6c824f902934
files Discovery/Src/t7.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
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);
             }