Skip to content

Commit ea003e3

Browse files
committed
Adjust comments
1 parent 0118647 commit ea003e3

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Diff for: src/Battery.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,9 @@ void Battery::configureBatteryCharacteristics(){
7171

7272
void Battery::releaseFromHibernation(){
7373
// See section "Soft-Wakeup" in user manual https://www.analog.com/media/en/technical-documentation/user-guides/max1726x-modelgauge-m5-ez-user-guide.pdf
74-
// TODO to preserve the hiberation config, probably better to only set bit 15 to 0
75-
writeRegister16Bits(this->wire, FUEL_GAUGE_ADDRESS, HIB_CFG_REG, 0x0); // Exit Hibernate Mode
74+
replaceRegisterBit(this->wire, FUEL_GAUGE_ADDRESS, HIB_CFG_REG, EN_HIBERNATION_BIT, 0); // Exit Hibernate Mode
7675
writeRegister16Bits(this->wire, FUEL_GAUGE_ADDRESS, SOFT_WAKEUP_REG, 0x90); // Wakes up the fuel gauge from hibernate mode to reduce the response time of the IC to configuration changes
77-
writeRegister16Bits(this->wire, FUEL_GAUGE_ADDRESS, SOFT_WAKEUP_REG, 0x0); // This command must be manually cleared (0x0000) afterward to keep proper fuel gauge timing
76+
writeRegister16Bits(this->wire, FUEL_GAUGE_ADDRESS, SOFT_WAKEUP_REG, 0x0); // Soft wake-up must be manually cleared (0x0000) afterward to keep proper fuel gauge timing
7877
}
7978

8079
bool Battery::refreshBatteryGaugeModel(){
@@ -207,7 +206,8 @@ uint8_t Battery::internalTemperature(){
207206
}
208207

209208
setTemperatureMeasurementMode(false);
210-
// TODO also see DieTemp Register (034h) for the internal die temperature p. 24 in DS
209+
// Also see DieTemp Register (034h) for the internal die temperature p. 24 in DS
210+
// If Config.TSel = 0, DieTemp and Temp registers have the value of the die temperature.
211211
return readRegister16Bits(this->wire, FUEL_GAUGE_ADDRESS, TEMP_REG) * TEMPERATURE_MULTIPLIER_C;
212212
}
213213

@@ -226,7 +226,6 @@ uint8_t Battery::batteryTemperature(){
226226
}
227227

228228
setTemperatureMeasurementMode(true);
229-
// TODO possibly await a couple of readings before getting a meaningful temperature
230229
return readRegister16Bits(this->wire, FUEL_GAUGE_ADDRESS, TEMP_REG) * TEMPERATURE_MULTIPLIER_C;
231230
}
232231

0 commit comments

Comments
 (0)