diff --git a/src/app/SAB.cpp b/src/app/SAB.cpp index 9975bba..779ac3b 100644 --- a/src/app/SAB.cpp +++ b/src/app/SAB.cpp @@ -107,9 +107,9 @@ SDCardConfig SAB::getSdCardConfig() const PowerInfo SAB::getPowerInfo(const unsigned char nbOfMeasures) const { - uint16_t batteryMeasures = 0, temp = 0; - unsigned char i = 0; - int checkLevel = 0; + uint16_t batteryMeasures(0), temp(0); + unsigned char i(0); + int checkLevel(0); PowerInfo p; for(;i < nbOfMeasures;i++) @@ -128,7 +128,7 @@ PowerInfo SAB::getPowerInfo(const unsigned char nbOfMeasures) const else { p.powerType = BATTERY; - checkLevel = ((batteryMeasures-BATT_EMPTY)*100/BATT_DIFF); + checkLevel = ((double)(batteryMeasures-BATT_EMPTY)*100.0/(double)BATT_DIFF); if(checkLevel > 100) p.level = 100;