Merge pull request #124 from IoTPanic/patch-waketime-iotpanic
Reduced interval where the display shows the previous time on wake
This commit is contained in:
commit
737a7e57ca
2 changed files with 6 additions and 7 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -5,6 +5,7 @@ CMakeFiles/
|
||||||
**/CMakeCache.txt
|
**/CMakeCache.txt
|
||||||
cmake_install.cmake
|
cmake_install.cmake
|
||||||
Makefile
|
Makefile
|
||||||
|
build/
|
||||||
|
|
||||||
# Resulting binary files
|
# Resulting binary files
|
||||||
*.a
|
*.a
|
||||||
|
|
|
@ -107,21 +107,22 @@ void SystemTask::Work() {
|
||||||
while(true) {
|
while(true) {
|
||||||
uint8_t msg;
|
uint8_t msg;
|
||||||
if (xQueueReceive(systemTasksMsgQueue, &msg, isSleeping ? 2500 : 1000)) {
|
if (xQueueReceive(systemTasksMsgQueue, &msg, isSleeping ? 2500 : 1000)) {
|
||||||
|
batteryController.Update();
|
||||||
Messages message = static_cast<Messages >(msg);
|
Messages message = static_cast<Messages >(msg);
|
||||||
switch(message) {
|
switch(message) {
|
||||||
case Messages::GoToRunning:
|
case Messages::GoToRunning:
|
||||||
spi.Wakeup();
|
spi.Wakeup();
|
||||||
twiMaster.Wakeup();
|
twiMaster.Wakeup();
|
||||||
|
|
||||||
|
nimbleController.StartAdvertising();
|
||||||
|
xTimerStart(idleTimer, 0);
|
||||||
spiNorFlash.Wakeup();
|
spiNorFlash.Wakeup();
|
||||||
lcd.Wakeup();
|
|
||||||
touchPanel.Wakeup();
|
touchPanel.Wakeup();
|
||||||
|
lcd.Wakeup();
|
||||||
|
|
||||||
displayApp->PushMessage(Applications::DisplayApp::Messages::GoToRunning);
|
displayApp->PushMessage(Applications::DisplayApp::Messages::GoToRunning);
|
||||||
displayApp->PushMessage(Applications::DisplayApp::Messages::UpdateBatteryLevel);
|
displayApp->PushMessage(Applications::DisplayApp::Messages::UpdateBatteryLevel);
|
||||||
|
|
||||||
xTimerStart(idleTimer, 0);
|
|
||||||
nimbleController.StartAdvertising();
|
|
||||||
isSleeping = false;
|
isSleeping = false;
|
||||||
isWakingUp = false;
|
isWakingUp = false;
|
||||||
break;
|
break;
|
||||||
|
@ -190,12 +191,9 @@ void SystemTask::Work() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
monitor.Process();
|
||||||
uint32_t systick_counter = nrf_rtc_counter_get(portNRF_RTC_REG);
|
uint32_t systick_counter = nrf_rtc_counter_get(portNRF_RTC_REG);
|
||||||
dateTimeController.UpdateTime(systick_counter);
|
dateTimeController.UpdateTime(systick_counter);
|
||||||
batteryController.Update();
|
|
||||||
|
|
||||||
monitor.Process();
|
|
||||||
|
|
||||||
if(!nrf_gpio_pin_read(pinButton))
|
if(!nrf_gpio_pin_read(pinButton))
|
||||||
watchdog.Kick();
|
watchdog.Kick();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue