From 1d4ff36e458c97e4d54fad2761789a1bc28f565f Mon Sep 17 00:00:00 2001 From: anschrammh Date: Sun, 28 Apr 2019 15:35:47 +0200 Subject: [PATCH] Minor changes to the SAB class --- src/app/SAB.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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;