Mercurial > public > ostc4
changeset 693:79ce499e26aa Betatest
Improvment charge percent visualization:
The percent display is now clipped to 100.0%. As small deviation may happen between physical battery and the theoretical counter value, percent > 100 may happen. To avoid confusion values > 100% are no longer displayed. In addition a small % has been added to the visualization of the value.
author | Ideenmodellierer |
---|---|
date | Fri, 05 Aug 2022 16:04:52 +0200 |
parents | b052e812277c |
children | 2a800dfe64f6 |
files | Discovery/Src/t7.c |
diffstat | 1 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/Discovery/Src/t7.c Fri Aug 05 15:27:01 2022 +0200 +++ b/Discovery/Src/t7.c Fri Aug 05 16:04:52 2022 +0200 @@ -3977,9 +3977,15 @@ speed = (localCharge - lastCharge) * 1000.0 / deltatime; } + if(localCharge > 100.0) + { + localCharge = 100.0; + } + lastCharge = localCharge; } + if(deltatime > 1000) { deltatime = 0; @@ -4011,7 +4017,7 @@ if((stateUsed->lifeData.battery_charge > 0) && (stateUsed->chargeStatus != CHARGER_off)) { snprintf(text,60, - "\001%0.2f\n\r" + "\001%0.2f\016\016%%\017\n\r" "\001%c%d\n\r" ,stateUsed->lifeData.battery_charge ,indicator