From 37c27687874bcafe2fcc8ac6fdba0b6d549d6434 Mon Sep 17 00:00:00 2001 From: Samuel Archibald Date: Mon, 2 Nov 2020 23:13:31 -0500 Subject: [PATCH] This is the actual fix, reducing the time between LCD is turned back on and the next task which will display the time is started. --- src/systemtask/SystemTask.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) 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(); }