diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index f82bfc6a..3271edcf 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -105,11 +105,8 @@ void SystemTask::Work() { #pragma clang diagnostic push #pragma ide diagnostic ignored "EndlessLoop" while(true) { - uint8_t msg; if (xQueueReceive(systemTasksMsgQueue, &msg, isSleeping ? 2500 : 1000)) { - uint32_t systick_counter = nrf_rtc_counter_get(portNRF_RTC_REG); - dateTimeController.UpdateTime(systick_counter); batteryController.Update(); Messages message = static_cast(msg); switch(message) { @@ -117,15 +114,15 @@ void SystemTask::Work() { spi.Wakeup(); twiMaster.Wakeup(); + nimbleController.StartAdvertising(); + xTimerStart(idleTimer, 0); spiNorFlash.Wakeup(); - lcd.Wakeup(); touchPanel.Wakeup(); + lcd.Wakeup(); displayApp->PushMessage(Applications::DisplayApp::Messages::GoToRunning); displayApp->PushMessage(Applications::DisplayApp::Messages::UpdateBatteryLevel); - xTimerStart(idleTimer, 0); - nimbleController.StartAdvertising(); isSleeping = false; isWakingUp = false; break; @@ -195,7 +192,7 @@ void SystemTask::Work() { } monitor.Process(); - + dateTimeController.UpdateTime(nrf_rtc_counter_get(portNRF_RTC_REG);); if(!nrf_gpio_pin_read(pinButton)) watchdog.Kick(); }