summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Archibald <samuel.archibald00@gmail.com>2020-11-03 04:13:31 (GMT)
committerSamuel Archibald <samuel.archibald00@gmail.com>2020-11-03 04:13:31 (GMT)
commit37c27687874bcafe2fcc8ac6fdba0b6d549d6434 (patch)
treeb52577f1af04326ee80b77a84046402f809aa995
parent10c52601879d80da55f5479a75ffb7f942ad2b61 (diff)
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.
-rw-r--r--src/systemtask/SystemTask.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp
index f82bfc6..3271edc 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<Messages >(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();
}