@@ -136,7 +136,6 @@ void SystemTask::Work() {
136136 touchPanel.Init ();
137137 dateTimeController.Register (this );
138138 batteryController.Register (this );
139- batteryController.Update ();
140139 motorController.Init ();
141140 motionSensor.SoftReset ();
142141 timerController.Register (this );
@@ -194,6 +193,8 @@ void SystemTask::Work() {
194193 nrf_gpio_cfg_sense_input (PinMap::PowerPresent, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_SENSE_HIGH);
195194 }
196195
196+ batteryController.MeasureVoltage ();
197+
197198 idleTimer = xTimerCreate (" idleTimer" , pdMS_TO_TICKS (2000 ), pdFALSE, this , IdleTimerCallback);
198199 dimTimer = xTimerCreate (" dimTimer" , pdMS_TO_TICKS (settingsController.GetScreenTimeOut () - 2000 ), pdFALSE, this , DimTimerCallback);
199200 measureBatteryTimer = xTimerCreate (" measureBattery" , batteryMeasurementPeriod, pdTRUE, this , MeasureBatteryTimerCallback);
@@ -345,11 +346,11 @@ void SystemTask::Work() {
345346 stepCounterMustBeReset = true ;
346347 break ;
347348 case Messages::OnChargingEvent:
348- batteryController.Update ();
349+ batteryController.ReadPowerState ();
349350 motorController.RunForDuration (15 );
350351 break ;
351352 case Messages::MeasureBatteryTimerExpired:
352- batteryController.Update ();
353+ batteryController.MeasureVoltage ();
353354 break ;
354355 case Messages::BatteryPercentageUpdated:
355356 nimbleController.NotifyBatteryLevel (batteryController.PercentRemaining ());
0 commit comments