move IDLE_POWER_SAVING_MS

This commit is contained in:
Xuan Son Nguyen
2026-02-12 13:19:37 +01:00
parent ea32ba0f8d
commit 73cd05827a
3 changed files with 10 additions and 9 deletions

View File

@@ -414,8 +414,7 @@ void loop() {
if (currentActivity && currentActivity->skipLoopDelay()) {
yield(); // Give FreeRTOS a chance to run tasks, but return immediately
} else {
static constexpr unsigned long IDLE_POWER_SAVING_MS = 3000; // 3 seconds
if (millis() - lastActivityTime >= IDLE_POWER_SAVING_MS) {
if (millis() - lastActivityTime >= HalPowerManager::IDLE_POWER_SAVING_MS) {
// If we've been inactive for a while, increase the delay to save power
powerManager.setPowerSaving(true); // Lower CPU frequency after extended inactivity
delay(50);