Minor changes to the SAB class

This commit is contained in:
anschrammh 2019-04-28 15:35:47 +02:00
parent f408d79523
commit 1d4ff36e45

View File

@ -107,9 +107,9 @@ SDCardConfig SAB::getSdCardConfig() const
PowerInfo SAB::getPowerInfo(const unsigned char nbOfMeasures) const PowerInfo SAB::getPowerInfo(const unsigned char nbOfMeasures) const
{ {
uint16_t batteryMeasures = 0, temp = 0; uint16_t batteryMeasures(0), temp(0);
unsigned char i = 0; unsigned char i(0);
int checkLevel = 0; int checkLevel(0);
PowerInfo p; PowerInfo p;
for(;i < nbOfMeasures;i++) for(;i < nbOfMeasures;i++)
@ -128,7 +128,7 @@ PowerInfo SAB::getPowerInfo(const unsigned char nbOfMeasures) const
else else
{ {
p.powerType = BATTERY; p.powerType = BATTERY;
checkLevel = ((batteryMeasures-BATT_EMPTY)*100/BATT_DIFF); checkLevel = ((double)(batteryMeasures-BATT_EMPTY)*100.0/(double)BATT_DIFF);
if(checkLevel > 100) if(checkLevel > 100)
p.level = 100; p.level = 100;