2020-02-23 07:44:39 -05:00
|
|
|
#include "SystemTask.h"
|
2020-11-15 09:05:51 -05:00
|
|
|
#define min // workaround: nimble's min/max macros conflict with libstdc++
|
|
|
|
#define max
|
2020-04-19 14:44:59 -04:00
|
|
|
#include <host/ble_gap.h>
|
2020-11-15 09:05:51 -05:00
|
|
|
#include <host/ble_gatt.h>
|
|
|
|
#include <host/ble_hs_adv.h>
|
2020-04-19 14:44:59 -04:00
|
|
|
#include <host/util/util.h>
|
2020-11-15 09:05:51 -05:00
|
|
|
#include <nimble/hci_common.h>
|
|
|
|
#undef max
|
|
|
|
#undef min
|
|
|
|
#include <hal/nrf_rtc.h>
|
|
|
|
#include <libraries/gpiote/app_gpiote.h>
|
|
|
|
#include <libraries/log/nrf_log.h>
|
|
|
|
|
|
|
|
#include "BootloaderVersion.h"
|
|
|
|
#include "components/ble/BleController.h"
|
|
|
|
#include "drivers/Cst816s.h"
|
|
|
|
#include "drivers/St7789.h"
|
|
|
|
#include "drivers/InternalFlash.h"
|
|
|
|
#include "drivers/SpiMaster.h"
|
|
|
|
#include "drivers/SpiNorFlash.h"
|
|
|
|
#include "drivers/TwiMaster.h"
|
2021-01-10 11:57:26 -05:00
|
|
|
#include "drivers/Hrs3300.h"
|
2020-10-04 08:11:21 -04:00
|
|
|
#include "main.h"
|
2020-04-19 15:26:09 -04:00
|
|
|
|
2021-03-16 08:43:50 -04:00
|
|
|
#include <memory>
|
|
|
|
|
2020-02-23 07:44:39 -05:00
|
|
|
using namespace Pinetime::System;
|
|
|
|
|
2020-06-01 14:40:11 -04:00
|
|
|
void IdleTimerCallback(TimerHandle_t xTimer) {
|
2020-06-13 11:33:49 -04:00
|
|
|
|
|
|
|
NRF_LOG_INFO("IdleTimerCallback");
|
2020-06-01 14:40:11 -04:00
|
|
|
auto sysTask = static_cast<SystemTask *>(pvTimerGetTimerID(xTimer));
|
|
|
|
sysTask->OnIdle();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-05-07 13:53:51 -04:00
|
|
|
SystemTask::SystemTask(Drivers::SpiMaster &spi, Drivers::St7789 &lcd,
|
2020-07-19 14:30:44 -04:00
|
|
|
Pinetime::Drivers::SpiNorFlash& spiNorFlash,
|
|
|
|
Drivers::TwiMaster& twiMaster, Drivers::Cst816S &touchPanel,
|
2020-03-28 14:05:28 -04:00
|
|
|
Components::LittleVgl &lvgl,
|
|
|
|
Controllers::Battery &batteryController, Controllers::Ble &bleController,
|
|
|
|
Controllers::DateTime &dateTimeController,
|
2021-01-25 10:47:52 -05:00
|
|
|
Pinetime::Controllers::MotorController& motorController,
|
2021-02-24 14:40:24 -05:00
|
|
|
Pinetime::Drivers::Hrs3300& heartRateSensor,
|
|
|
|
Controllers::Settings &settingsController) :
|
2020-07-19 14:30:44 -04:00
|
|
|
spi{spi}, lcd{lcd}, spiNorFlash{spiNorFlash},
|
|
|
|
twiMaster{twiMaster}, touchPanel{touchPanel}, lvgl{lvgl}, batteryController{batteryController},
|
2021-01-10 16:02:21 -05:00
|
|
|
heartRateController{*this},
|
2020-03-22 07:03:17 -04:00
|
|
|
bleController{bleController}, dateTimeController{dateTimeController},
|
2021-01-24 11:22:39 -05:00
|
|
|
watchdog{}, watchdogView{watchdog},
|
2021-01-25 10:47:52 -05:00
|
|
|
motorController{motorController}, heartRateSensor{heartRateSensor},
|
2021-02-24 14:40:24 -05:00
|
|
|
settingsController{settingsController},
|
2021-01-17 10:34:14 -05:00
|
|
|
nimbleController(*this, bleController,dateTimeController, notificationManager, batteryController, spiNorFlash, heartRateController) {
|
2020-10-04 08:13:01 -04:00
|
|
|
systemTasksMsgQueue = xQueueCreate(10, 1);
|
2020-02-23 07:44:39 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void SystemTask::Start() {
|
2020-02-23 10:14:03 -05:00
|
|
|
if (pdPASS != xTaskCreate(SystemTask::Process, "MAIN", 350, this, 0, &taskHandle))
|
2020-02-23 07:44:39 -05:00
|
|
|
APP_ERROR_HANDLER(NRF_ERROR_NO_MEM);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SystemTask::Process(void *instance) {
|
|
|
|
auto *app = static_cast<SystemTask *>(instance);
|
2020-10-02 14:45:21 -04:00
|
|
|
NRF_LOG_INFO("systemtask task started!");
|
2020-02-23 07:44:39 -05:00
|
|
|
app->Work();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SystemTask::Work() {
|
2020-06-27 10:11:42 -04:00
|
|
|
watchdog.Setup(7);
|
|
|
|
watchdog.Start();
|
2020-02-23 15:09:11 -05:00
|
|
|
NRF_LOG_INFO("Last reset reason : %s", Pinetime::Drivers::Watchdog::ResetReasonToString(watchdog.ResetReason()));
|
2020-02-23 07:44:39 -05:00
|
|
|
APP_GPIOTE_INIT(2);
|
2020-04-19 14:44:59 -04:00
|
|
|
|
2020-05-11 12:50:37 -04:00
|
|
|
spi.Init();
|
|
|
|
spiNorFlash.Init();
|
2020-09-20 08:31:26 -04:00
|
|
|
spiNorFlash.Wakeup();
|
2020-04-19 15:26:09 -04:00
|
|
|
nimbleController.Init();
|
|
|
|
nimbleController.StartAdvertising();
|
2021-01-26 14:31:45 -05:00
|
|
|
brightnessController.Init();
|
2020-02-23 07:44:39 -05:00
|
|
|
lcd.Init();
|
2020-05-11 12:50:37 -04:00
|
|
|
|
2020-07-19 14:30:44 -04:00
|
|
|
twiMaster.Init();
|
2020-02-23 07:44:39 -05:00
|
|
|
touchPanel.Init();
|
|
|
|
batteryController.Init();
|
2021-02-05 09:43:20 -05:00
|
|
|
motorController.Init();
|
2021-02-14 08:19:30 -05:00
|
|
|
|
2021-02-24 14:40:24 -05:00
|
|
|
settingsController.Init();
|
|
|
|
|
2020-02-23 07:44:39 -05:00
|
|
|
|
2021-03-16 08:43:50 -04:00
|
|
|
displayApp = std::make_unique<Pinetime::Applications::DisplayApp>(lcd, lvgl, touchPanel, batteryController, bleController,
|
2021-02-14 08:19:30 -05:00
|
|
|
dateTimeController, watchdogView, *this, notificationManager,
|
2021-03-22 13:23:49 -04:00
|
|
|
heartRateController, settingsController);
|
2020-02-23 07:44:39 -05:00
|
|
|
displayApp->Start();
|
|
|
|
|
|
|
|
batteryController.Update();
|
2021-01-26 14:31:45 -05:00
|
|
|
displayApp->PushMessage(Pinetime::Applications::Display::Messages::UpdateBatteryLevel);
|
2020-02-23 07:44:39 -05:00
|
|
|
|
2021-01-10 11:57:26 -05:00
|
|
|
heartRateSensor.Init();
|
|
|
|
heartRateSensor.Disable();
|
2021-03-22 13:56:26 -04:00
|
|
|
heartRateApp = std::make_unique<Pinetime::Applications::HeartRateTask>(heartRateSensor, heartRateController);
|
2021-01-10 11:57:26 -05:00
|
|
|
heartRateApp->Start();
|
|
|
|
|
|
|
|
|
2020-02-23 07:44:39 -05:00
|
|
|
nrf_gpio_cfg_sense_input(pinButton, (nrf_gpio_pin_pull_t)GPIO_PIN_CNF_PULL_Pulldown, (nrf_gpio_pin_sense_t)GPIO_PIN_CNF_SENSE_High);
|
|
|
|
nrf_gpio_cfg_output(15);
|
|
|
|
nrf_gpio_pin_set(15);
|
|
|
|
|
|
|
|
nrfx_gpiote_in_config_t pinConfig;
|
|
|
|
pinConfig.skip_gpio_setup = true;
|
|
|
|
pinConfig.hi_accuracy = false;
|
|
|
|
pinConfig.is_watcher = false;
|
|
|
|
pinConfig.sense = (nrf_gpiote_polarity_t)NRF_GPIOTE_POLARITY_HITOLO;
|
|
|
|
pinConfig.pull = (nrf_gpio_pin_pull_t)GPIO_PIN_CNF_PULL_Pulldown;
|
|
|
|
|
|
|
|
nrfx_gpiote_in_init(pinButton, &pinConfig, nrfx_gpiote_evt_handler);
|
|
|
|
|
|
|
|
nrf_gpio_cfg_sense_input(pinTouchIrq, (nrf_gpio_pin_pull_t)GPIO_PIN_CNF_PULL_Pullup, (nrf_gpio_pin_sense_t)GPIO_PIN_CNF_SENSE_Low);
|
|
|
|
|
|
|
|
pinConfig.skip_gpio_setup = true;
|
|
|
|
pinConfig.hi_accuracy = false;
|
|
|
|
pinConfig.is_watcher = false;
|
|
|
|
pinConfig.sense = (nrf_gpiote_polarity_t)NRF_GPIOTE_POLARITY_HITOLO;
|
|
|
|
pinConfig.pull = (nrf_gpio_pin_pull_t)GPIO_PIN_CNF_PULL_Pullup;
|
|
|
|
|
|
|
|
nrfx_gpiote_in_init(pinTouchIrq, &pinConfig, nrfx_gpiote_evt_handler);
|
|
|
|
|
2021-04-03 22:08:51 -04:00
|
|
|
idleTimer = xTimerCreate ("idleTimer", pdMS_TO_TICKS(settingsController.GetScreenTimeOut()), pdFALSE, this, IdleTimerCallback);
|
2020-06-01 14:40:11 -04:00
|
|
|
xTimerStart(idleTimer, 0);
|
2020-02-23 07:44:39 -05:00
|
|
|
|
2020-10-04 08:08:48 -04:00
|
|
|
// Suppress endless loop diagnostic
|
|
|
|
#pragma clang diagnostic push
|
|
|
|
#pragma ide diagnostic ignored "EndlessLoop"
|
2020-02-23 07:44:39 -05:00
|
|
|
while(true) {
|
|
|
|
uint8_t msg;
|
2020-10-04 08:11:21 -04:00
|
|
|
if (xQueueReceive(systemTasksMsgQueue, &msg, isSleeping ? 2500 : 1000)) {
|
2020-11-02 21:14:28 -05:00
|
|
|
batteryController.Update();
|
2020-02-23 07:44:39 -05:00
|
|
|
Messages message = static_cast<Messages >(msg);
|
|
|
|
switch(message) {
|
2021-04-03 22:08:51 -04:00
|
|
|
case Messages::EnableSleeping:
|
|
|
|
doNotGoToSleep = false;
|
|
|
|
break;
|
|
|
|
case Messages::DisableSleeping:
|
|
|
|
doNotGoToSleep = true;
|
|
|
|
break;
|
|
|
|
case Messages::UpdateTimeOut:
|
|
|
|
xTimerChangePeriod(idleTimer, pdMS_TO_TICKS(settingsController.GetScreenTimeOut()), 0);
|
|
|
|
break;
|
2020-06-01 14:40:11 -04:00
|
|
|
case Messages::GoToRunning:
|
2020-09-13 15:26:44 -04:00
|
|
|
spi.Wakeup();
|
2021-04-04 08:51:22 -04:00
|
|
|
|
|
|
|
// Double Tap needs the touch screen to be in normal mode
|
|
|
|
if ( settingsController.getWakeUpMode() != Pinetime::Controllers::Settings::WakeUpMode::DoubleTap ) {
|
|
|
|
twiMaster.Wakeup();
|
|
|
|
touchPanel.Wakeup();
|
|
|
|
}
|
2020-09-13 15:26:44 -04:00
|
|
|
|
2020-11-02 23:13:31 -05:00
|
|
|
nimbleController.StartAdvertising();
|
|
|
|
xTimerStart(idleTimer, 0);
|
2021-04-03 22:08:51 -04:00
|
|
|
spiNorFlash.Wakeup();
|
2020-11-02 23:13:31 -05:00
|
|
|
lcd.Wakeup();
|
2020-09-13 15:26:44 -04:00
|
|
|
|
2021-01-26 14:31:45 -05:00
|
|
|
displayApp->PushMessage(Pinetime::Applications::Display::Messages::GoToRunning);
|
|
|
|
displayApp->PushMessage(Pinetime::Applications::Display::Messages::UpdateBatteryLevel);
|
2021-01-17 04:39:46 -05:00
|
|
|
heartRateApp->PushMessage(Pinetime::Applications::HeartRateTask::Messages::WakeUp);
|
2020-09-13 15:26:44 -04:00
|
|
|
|
|
|
|
isSleeping = false;
|
|
|
|
isWakingUp = false;
|
2020-06-01 14:40:11 -04:00
|
|
|
break;
|
2020-02-23 07:44:39 -05:00
|
|
|
case Messages::GoToSleep:
|
2020-09-13 15:26:44 -04:00
|
|
|
isGoingToSleep = true;
|
2020-10-02 14:45:21 -04:00
|
|
|
NRF_LOG_INFO("[systemtask] Going to sleep");
|
2020-06-13 11:33:49 -04:00
|
|
|
xTimerStop(idleTimer, 0);
|
2021-01-26 14:31:45 -05:00
|
|
|
displayApp->PushMessage(Pinetime::Applications::Display::Messages::GoToSleep);
|
2021-01-17 04:39:46 -05:00
|
|
|
heartRateApp->PushMessage(Pinetime::Applications::HeartRateTask::Messages::GoToSleep);
|
2020-06-01 14:40:11 -04:00
|
|
|
break;
|
2020-03-25 16:23:40 -04:00
|
|
|
case Messages::OnNewTime:
|
2020-07-04 12:10:30 -04:00
|
|
|
ReloadIdleTimer();
|
2021-01-26 14:31:45 -05:00
|
|
|
displayApp->PushMessage(Pinetime::Applications::Display::Messages::UpdateDateTime);
|
2020-03-25 16:23:40 -04:00
|
|
|
break;
|
|
|
|
case Messages::OnNewNotification:
|
2020-09-13 15:26:44 -04:00
|
|
|
if(isSleeping && !isWakingUp) GoToRunning();
|
2021-04-03 22:08:51 -04:00
|
|
|
motorController.SetDuration(35);
|
2021-01-26 14:31:45 -05:00
|
|
|
displayApp->PushMessage(Pinetime::Applications::Display::Messages::NewNotification);
|
2020-03-25 16:23:40 -04:00
|
|
|
break;
|
2020-05-01 15:58:31 -04:00
|
|
|
case Messages::BleConnected:
|
2020-07-04 12:10:30 -04:00
|
|
|
ReloadIdleTimer();
|
2020-05-01 15:58:31 -04:00
|
|
|
isBleDiscoveryTimerRunning = true;
|
|
|
|
bleDiscoveryTimer = 5;
|
|
|
|
break;
|
2020-05-02 08:16:57 -04:00
|
|
|
case Messages::BleFirmwareUpdateStarted:
|
2020-06-01 14:40:11 -04:00
|
|
|
doNotGoToSleep = true;
|
2020-09-13 15:26:44 -04:00
|
|
|
if(isSleeping && !isWakingUp) GoToRunning();
|
2021-01-26 14:31:45 -05:00
|
|
|
displayApp->PushMessage(Pinetime::Applications::Display::Messages::BleFirmwareUpdateStarted);
|
2020-05-02 08:16:57 -04:00
|
|
|
break;
|
|
|
|
case Messages::BleFirmwareUpdateFinished:
|
2020-06-01 14:40:11 -04:00
|
|
|
doNotGoToSleep = false;
|
|
|
|
xTimerStart(idleTimer, 0);
|
2020-06-01 10:30:24 -04:00
|
|
|
if(bleController.State() == Pinetime::Controllers::Ble::FirmwareUpdateStates::Validated)
|
|
|
|
NVIC_SystemReset();
|
2020-05-02 08:16:57 -04:00
|
|
|
break;
|
2020-06-01 14:40:11 -04:00
|
|
|
case Messages::OnTouchEvent:
|
2020-07-04 12:10:30 -04:00
|
|
|
ReloadIdleTimer();
|
2020-06-01 14:40:11 -04:00
|
|
|
break;
|
|
|
|
case Messages::OnButtonEvent:
|
2020-07-04 12:10:30 -04:00
|
|
|
ReloadIdleTimer();
|
2020-06-01 14:40:11 -04:00
|
|
|
break;
|
2020-08-22 11:59:59 -04:00
|
|
|
case Messages::OnDisplayTaskSleeping:
|
2020-10-27 14:38:45 -04:00
|
|
|
if(BootloaderVersion::IsValid()) {
|
|
|
|
// First versions of the bootloader do not expose their version and cannot initialize the SPI NOR FLASH
|
|
|
|
// if it's in sleep mode. Avoid bricked device by disabling sleep mode on these versions.
|
|
|
|
spiNorFlash.Sleep();
|
|
|
|
}
|
2020-08-22 11:59:59 -04:00
|
|
|
lcd.Sleep();
|
|
|
|
spi.Sleep();
|
2021-04-03 22:08:51 -04:00
|
|
|
|
|
|
|
// Double Tap needs the touch screen to be in normal mode
|
|
|
|
if ( settingsController.getWakeUpMode() != Pinetime::Controllers::Settings::WakeUpMode::DoubleTap ) {
|
2021-04-04 08:51:22 -04:00
|
|
|
touchPanel.Sleep();
|
|
|
|
twiMaster.Sleep();
|
2021-04-03 22:08:51 -04:00
|
|
|
}
|
|
|
|
|
2020-09-13 15:26:44 -04:00
|
|
|
isSleeping = true;
|
|
|
|
isGoingToSleep = false;
|
2020-08-22 11:59:59 -04:00
|
|
|
break;
|
2020-02-23 07:44:39 -05:00
|
|
|
default: break;
|
|
|
|
}
|
|
|
|
}
|
2020-05-01 15:58:31 -04:00
|
|
|
|
|
|
|
if(isBleDiscoveryTimerRunning) {
|
|
|
|
if(bleDiscoveryTimer == 0) {
|
|
|
|
isBleDiscoveryTimerRunning = false;
|
|
|
|
// Services discovery is deffered from 3 seconds to avoid the conflicts between the host communicating with the
|
|
|
|
// tharget and vice-versa. I'm not sure if this is the right way to handle this...
|
|
|
|
nimbleController.StartDiscovery();
|
|
|
|
} else {
|
|
|
|
bleDiscoveryTimer--;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-02 15:38:52 -04:00
|
|
|
monitor.Process();
|
2020-11-19 15:44:57 -05:00
|
|
|
uint32_t systick_counter = nrf_rtc_counter_get(portNRF_RTC_REG);
|
2020-11-19 15:50:39 -05:00
|
|
|
dateTimeController.UpdateTime(systick_counter);
|
2020-02-23 15:09:11 -05:00
|
|
|
if(!nrf_gpio_pin_read(pinButton))
|
|
|
|
watchdog.Kick();
|
2020-02-23 07:44:39 -05:00
|
|
|
}
|
2020-10-04 09:24:52 -04:00
|
|
|
// Clear diagnostic suppression
|
|
|
|
#pragma clang diagnostic pop
|
2020-02-23 07:44:39 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void SystemTask::OnButtonPushed() {
|
2020-09-13 15:26:44 -04:00
|
|
|
if(isGoingToSleep) return;
|
2020-02-23 07:44:39 -05:00
|
|
|
if(!isSleeping) {
|
2020-10-02 14:45:21 -04:00
|
|
|
NRF_LOG_INFO("[systemtask] Button pushed");
|
2020-06-01 14:40:11 -04:00
|
|
|
PushMessage(Messages::OnButtonEvent);
|
2021-01-26 14:31:45 -05:00
|
|
|
displayApp->PushMessage(Pinetime::Applications::Display::Messages::ButtonPushed);
|
2020-02-23 07:44:39 -05:00
|
|
|
}
|
|
|
|
else {
|
2020-09-13 15:26:44 -04:00
|
|
|
if(!isWakingUp) {
|
2020-10-02 14:45:21 -04:00
|
|
|
NRF_LOG_INFO("[systemtask] Button pushed, waking up");
|
2020-09-13 15:26:44 -04:00
|
|
|
GoToRunning();
|
|
|
|
}
|
2020-02-23 07:44:39 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-01 14:40:11 -04:00
|
|
|
void SystemTask::GoToRunning() {
|
2020-09-13 15:26:44 -04:00
|
|
|
isWakingUp = true;
|
2020-06-01 14:40:11 -04:00
|
|
|
PushMessage(Messages::GoToRunning);
|
|
|
|
}
|
|
|
|
|
2020-02-23 07:44:39 -05:00
|
|
|
void SystemTask::OnTouchEvent() {
|
2020-09-13 15:26:44 -04:00
|
|
|
if(isGoingToSleep) return ;
|
2020-06-01 14:40:11 -04:00
|
|
|
if(!isSleeping) {
|
|
|
|
PushMessage(Messages::OnTouchEvent);
|
2021-01-26 14:31:45 -05:00
|
|
|
displayApp->PushMessage(Pinetime::Applications::Display::Messages::TouchEvent);
|
2021-04-03 22:08:51 -04:00
|
|
|
} else if(!isWakingUp) {
|
|
|
|
if( settingsController.getWakeUpMode() == Pinetime::Controllers::Settings::WakeUpMode::None or
|
|
|
|
settingsController.getWakeUpMode() == Pinetime::Controllers::Settings::WakeUpMode::RaiseWrist ) return;
|
|
|
|
|
|
|
|
if( settingsController.getWakeUpMode() == Pinetime::Controllers::Settings::WakeUpMode::SingleTap ) {
|
|
|
|
GoToRunning();
|
|
|
|
} else if( settingsController.getWakeUpMode() == Pinetime::Controllers::Settings::WakeUpMode::DoubleTap ) {
|
|
|
|
// error
|
2021-04-04 08:51:22 -04:00
|
|
|
auto info = touchPanel.GetTouchInfo();
|
2021-04-03 22:08:51 -04:00
|
|
|
if( info.isTouch and info.gesture == Pinetime::Drivers::Cst816S::Gestures::DoubleTap ) {
|
|
|
|
GoToRunning();
|
2021-04-04 08:51:22 -04:00
|
|
|
}
|
2021-04-03 22:08:51 -04:00
|
|
|
}
|
2020-06-01 14:40:11 -04:00
|
|
|
}
|
2020-02-23 07:44:39 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void SystemTask::PushMessage(SystemTask::Messages msg) {
|
2020-09-13 15:26:44 -04:00
|
|
|
if(msg == Messages::GoToSleep) {
|
|
|
|
isGoingToSleep = true;
|
|
|
|
}
|
2020-02-23 07:44:39 -05:00
|
|
|
BaseType_t xHigherPriorityTaskWoken;
|
|
|
|
xHigherPriorityTaskWoken = pdFALSE;
|
2020-10-04 08:13:01 -04:00
|
|
|
xQueueSendFromISR(systemTasksMsgQueue, &msg, &xHigherPriorityTaskWoken);
|
2020-02-23 07:44:39 -05:00
|
|
|
if (xHigherPriorityTaskWoken) {
|
|
|
|
/* Actual macro used here is port specific. */
|
2020-10-04 08:08:48 -04:00
|
|
|
// TODO: should I do something here?
|
2020-02-23 07:44:39 -05:00
|
|
|
}
|
|
|
|
}
|
2020-06-01 14:40:11 -04:00
|
|
|
|
|
|
|
void SystemTask::OnIdle() {
|
|
|
|
if(doNotGoToSleep) return;
|
|
|
|
NRF_LOG_INFO("Idle timeout -> Going to sleep")
|
|
|
|
PushMessage(Messages::GoToSleep);
|
|
|
|
}
|
2020-07-04 12:10:30 -04:00
|
|
|
|
|
|
|
void SystemTask::ReloadIdleTimer() const {
|
2020-09-13 15:26:44 -04:00
|
|
|
if(isSleeping || isGoingToSleep) return;
|
2020-07-04 12:10:30 -04:00
|
|
|
xTimerReset(idleTimer, 0);
|
|
|
|
}
|