mirror of
https://github.com/InfiniTimeOrg/InfiniTime.git
synced 2024-10-22 23:21:53 +02:00
Compare commits
4 commits
27de7d8d19
...
b5e2f768e6
Author | SHA1 | Date | |
---|---|---|---|
b5e2f768e6 | |||
6e03b47eb3 | |||
491d3ae20f | |||
7ad970ea87 |
|
@ -186,7 +186,7 @@ void SystemTask::Work() {
|
||||||
UpdateMotion();
|
UpdateMotion();
|
||||||
|
|
||||||
Messages msg;
|
Messages msg;
|
||||||
if (xQueueReceive(systemTasksMsgQueue, &msg, 100) == pdTRUE) {
|
if (xQueueReceive(systemTasksMsgQueue, &msg, GetQueueTimeout()) == pdTRUE) {
|
||||||
switch (msg) {
|
switch (msg) {
|
||||||
case Messages::EnableSleeping:
|
case Messages::EnableSleeping:
|
||||||
wakeLocksHeld--;
|
wakeLocksHeld--;
|
||||||
|
@ -499,3 +499,15 @@ void SystemTask::PushMessage(System::Messages msg) {
|
||||||
xQueueSend(systemTasksMsgQueue, &msg, portMAX_DELAY);
|
xQueueSend(systemTasksMsgQueue, &msg, portMAX_DELAY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TickType_t SystemTask::GetQueueTimeout() const {
|
||||||
|
// By default, the timeout on the queue is 100ms.
|
||||||
|
// It's extended to 4s in sleep mode, when no motion based wake up option is enabled.
|
||||||
|
TickType_t timeout = pdMS_TO_TICKS(100);
|
||||||
|
if (state == SystemTaskState::Sleeping && ((!settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::RaiseWrist) &&
|
||||||
|
!settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::Shake)) ||
|
||||||
|
settingsController.GetNotificationStatus() == Controllers::Settings::Notification::Sleep)) {
|
||||||
|
timeout = pdMS_TO_TICKS(4000);
|
||||||
|
}
|
||||||
|
return timeout;
|
||||||
|
}
|
|
@ -136,6 +136,8 @@ namespace Pinetime {
|
||||||
bool stepCounterMustBeReset = false;
|
bool stepCounterMustBeReset = false;
|
||||||
static constexpr TickType_t batteryMeasurementPeriod = pdMS_TO_TICKS(10 * 60 * 1000);
|
static constexpr TickType_t batteryMeasurementPeriod = pdMS_TO_TICKS(10 * 60 * 1000);
|
||||||
|
|
||||||
|
TickType_t GetQueueTimeout() const;
|
||||||
|
|
||||||
SystemMonitor monitor;
|
SystemMonitor monitor;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue