Compare commits

...

4 commits

Author SHA1 Message Date
JF b5e2f768e6
Merge 6e03b47eb3 into a2356f2f4a 2024-09-29 23:50:24 -04:00
Jean-François Milants 6e03b47eb3 Power optimization - Increase SystemTask Period
Increase the SystemTask period also when the notification mode is set to Sleep (as it also disables the motion-based wake options).
2023-05-18 15:49:14 +02:00
Jean-François Milants 491d3ae20f Power optimization - Increase SystemTaskPeriod
Improve the timeout on the queue : by default, the timeout is 100ms, and it's extended to 4s in sleep mode, when no motion based wake up option is enabled.
2023-05-08 21:23:54 +02:00
Jean-François Milants 7ad970ea87 Power optimization - Increase SystemTaskPeriod.
Increase the timeout on the message queue in SystemTask. This reduces the power consumption by 60-70µs in sleep mode.
2023-05-07 18:20:49 +02:00
2 changed files with 15 additions and 1 deletions

View file

@ -186,7 +186,7 @@ void SystemTask::Work() {
UpdateMotion();
Messages msg;
if (xQueueReceive(systemTasksMsgQueue, &msg, 100) == pdTRUE) {
if (xQueueReceive(systemTasksMsgQueue, &msg, GetQueueTimeout()) == pdTRUE) {
switch (msg) {
case Messages::EnableSleeping:
wakeLocksHeld--;
@ -499,3 +499,15 @@ void SystemTask::PushMessage(System::Messages msg) {
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;
}

View file

@ -136,6 +136,8 @@ namespace Pinetime {
bool stepCounterMustBeReset = false;
static constexpr TickType_t batteryMeasurementPeriod = pdMS_TO_TICKS(10 * 60 * 1000);
TickType_t GetQueueTimeout() const;
SystemMonitor monitor;
};
}