Minor changes to the SAB class
This commit is contained in:
parent
f408d79523
commit
1d4ff36e45
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user