Mercurial > public > ostc4
diff Discovery/Src/logbook.c @ 671:b456be1e152d Betatest
Support of unknown charging counter values:
The RTE now provides negativ charge counter values in case the counter value has not yet been confirmed by a completed charge cycle. Some condition checks needed to be updated to be compatible with the usage of negativ values.
author | Ideenmodellierer |
---|---|
date | Sat, 12 Mar 2022 22:58:22 +0100 |
parents | 1b995079c045 |
children | 63c340abd70e |
line wrap: on
line diff
--- a/Discovery/Src/logbook.c Sat Mar 12 22:54:26 2022 +0100 +++ b/Discovery/Src/logbook.c Sat Mar 12 22:58:22 2022 +0100 @@ -1309,7 +1309,14 @@ logbook_SetCompartmentDesaturation(pStateReal); logbook_SetLastStop(pStateReal->diveSettings.last_stop_depth_bar); gheader.batteryVoltage = pStateReal->lifeData.battery_voltage * 1000; - gheader.batteryCharge = pStateReal->lifeData.battery_charge; + if(pStateReal->lifeData.battery_charge > 0.0) + { + gheader.batteryCharge = pStateReal->lifeData.battery_charge; + } + else + { + gheader.batteryCharge = 0.0; + } logbook_EndDive(); bDiveMode = 0; } else