diff options
author | Samuel Archibald <samuel.archibald00@gmail.com> | 2020-11-02 21:14:28 -0500 |
---|---|---|
committer | Samuel Archibald <samuel.archibald00@gmail.com> | 2020-11-02 21:14:28 -0500 |
commit | 10c52601879d80da55f5479a75ffb7f942ad2b61 (patch) | |
tree | 4d4ec3bf542604e36b753de0e97f65735996d9ef | |
parent | 0e97db1c30748d9893291a27504bb55723f58e7d (diff) |
Fixed displaying last displayed time for ~100ms on wake
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | src/systemtask/SystemTask.cpp | 8 |
2 files changed, 5 insertions, 4 deletions
@@ -5,6 +5,7 @@ CMakeFiles/ **/CMakeCache.txt cmake_install.cmake Makefile +build/ # Resulting binary files *.a diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index dac4ce29..f82bfc6a 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -105,8 +105,12 @@ 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<Messages >(msg); switch(message) { case Messages::GoToRunning: @@ -190,10 +194,6 @@ void SystemTask::Work() { } } - uint32_t systick_counter = nrf_rtc_counter_get(portNRF_RTC_REG); - dateTimeController.UpdateTime(systick_counter); - batteryController.Update(); - monitor.Process(); if(!nrf_gpio_pin_read(pinButton)) |