@@ -347,26 +347,29 @@ void Tracker::initBatteryMonitor() {
347
347
// In order to disable charging safely we want to enable the PMIC watchdog so that
348
348
// if anything happens during the procedure that the circuit can return to
349
349
// normal operation in the event the MCU doesn't complete.
350
- PMIC pmic (true );
351
- FuelGauge fuelGauge;
352
-
353
- pmic.setWatchdog (0x1 ); // 40 seconds
354
- pmic.disableCharging ();
355
- // Delay so that the bulk capacitance and battery can equalize
356
- delay (_commonCfgData.postChargeSettleTime );
357
350
358
351
TrackerFuelGauge::instance ().init ();
359
352
360
- fuelGauge.quickStart ();
361
- // Must delay at least 175ms after quickstart, before calling
362
- // getSoC(), or reading will not have updated yet.
363
- delay (200 );
364
-
365
- _forceDisableCharging = _deviceConfig.disableCharging ();
366
- if (_batterySafeToCharge && !_forceDisableCharging) {
367
- pmic.enableCharging ();
353
+ {
354
+ PMIC pmic (true );
355
+ FuelGauge fuelGauge;
356
+
357
+ pmic.setWatchdog (0x1 ); // 40 seconds
358
+ pmic.disableCharging ();
359
+ // Delay so that the bulk capacitance and battery can equalize
360
+ delay (_commonCfgData.postChargeSettleTime );
361
+
362
+ fuelGauge.quickStart ();
363
+ // Must delay at least 175ms after quickstart, before calling
364
+ // getSoC(), or reading will not have updated yet.
365
+ delay (200 );
366
+
367
+ _forceDisableCharging = _deviceConfig.disableCharging ();
368
+ if (_batterySafeToCharge && !_forceDisableCharging) {
369
+ pmic.enableCharging ();
370
+ }
371
+ pmic.disableWatchdog ();
368
372
}
369
- pmic.disableWatchdog ();
370
373
}
371
374
372
375
bool Tracker::getChargeEnabled () {
0 commit comments