diff options
| author | JF002 <JF002@users.noreply.github.com> | 2020-12-01 20:20:02 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-01 20:20:02 (GMT) |
| commit | 737a7e57ca803108d773b6e1fa6fc4175d57730a (patch) | |
| tree | 79a274b2beeba4277ac664524440be20ba4e698a /src | |
| parent | 83d1bdd03cb12bf24d14a6d020cda0d09d7ae6c0 (diff) | |
| parent | e180ec5f3a45e5ad4774ca915c84dff481692206 (diff) | |
Merge pull request #124 from IoTPanic/patch-waketime-iotpanic
Reduced interval where the display shows the previous time on wake
Diffstat (limited to 'src')
| -rw-r--r-- | src/systemtask/SystemTask.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index dac4ce2..3177bce 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -107,21 +107,22 @@ void SystemTask::Work() { while(true) { uint8_t msg; if (xQueueReceive(systemTasksMsgQueue, &msg, isSleeping ? 2500 : 1000)) { + batteryController.Update(); Messages message = static_cast<Messages >(msg); switch(message) { case Messages::GoToRunning: 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; @@ -190,12 +191,9 @@ void SystemTask::Work() { } } + monitor.Process(); 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)) watchdog.Kick(); } |
