Don't measure and notify percentage on charging event.
This commit is contained in:
@@ -136,7 +136,6 @@ void SystemTask::Work() {
|
||||
touchPanel.Init();
|
||||
dateTimeController.Register(this);
|
||||
batteryController.Register(this);
|
||||
batteryController.Update();
|
||||
motorController.Init();
|
||||
motionSensor.SoftReset();
|
||||
timerController.Register(this);
|
||||
@@ -194,6 +193,8 @@ void SystemTask::Work() {
|
||||
nrf_gpio_cfg_sense_input(PinMap::PowerPresent, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_SENSE_HIGH);
|
||||
}
|
||||
|
||||
batteryController.MeasureVoltage();
|
||||
|
||||
idleTimer = xTimerCreate("idleTimer", pdMS_TO_TICKS(2000), pdFALSE, this, IdleTimerCallback);
|
||||
dimTimer = xTimerCreate("dimTimer", pdMS_TO_TICKS(settingsController.GetScreenTimeOut() - 2000), pdFALSE, this, DimTimerCallback);
|
||||
measureBatteryTimer = xTimerCreate("measureBattery", batteryMeasurementPeriod, pdTRUE, this, MeasureBatteryTimerCallback);
|
||||
@@ -345,11 +346,11 @@ void SystemTask::Work() {
|
||||
stepCounterMustBeReset = true;
|
||||
break;
|
||||
case Messages::OnChargingEvent:
|
||||
batteryController.Update();
|
||||
batteryController.ReadPowerState();
|
||||
motorController.RunForDuration(15);
|
||||
break;
|
||||
case Messages::MeasureBatteryTimerExpired:
|
||||
batteryController.Update();
|
||||
batteryController.MeasureVoltage();
|
||||
break;
|
||||
case Messages::BatteryPercentageUpdated:
|
||||
nimbleController.NotifyBatteryLevel(batteryController.PercentRemaining());
|
||||
|
Reference in New Issue
Block a user