comparison Discovery/Src/check_warning.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 6de83d8205a0
comparison
equal deleted inserted replaced
670:7a352b449055 671:b456be1e152d
346 } 346 }
347 347
348 348
349 static int8_t check_Battery(SDiveState * pDiveState) 349 static int8_t check_Battery(SDiveState * pDiveState)
350 { 350 {
351 if(pDiveState->lifeData.battery_charge < 10) 351 if((pDiveState->lifeData.battery_charge > 0) && (pDiveState->lifeData.battery_charge < 10))
352 pDiveState->warnings.lowBattery = 1; 352 pDiveState->warnings.lowBattery = 1;
353 else 353 else
354 pDiveState->warnings.lowBattery = 0; 354 pDiveState->warnings.lowBattery = 0;
355 355
356 return pDiveState->warnings.lowBattery; 356 return pDiveState->warnings.lowBattery;