Improve Power State Update Task timing

This commit is contained in:
2025-02-16 19:17:36 +01:00
parent a48dd7c9dd
commit fd1be4ffeb
2 changed files with 8 additions and 1 deletions

View File

@ -14,8 +14,11 @@ SemaphoreHandle_t PowerManager::powerMutex = NULL;
void vTaskUpdatePowerState(void *pvParameters) {
for (;;) {
ESP_LOGV(TAG, "Updating Power State...");
TickType_t executionStart = xTaskGetTickCount();
PowerManager::updatePowerStateHandler();
vTaskDelay(pdMS_TO_TICKS(10));
vTaskDelayUntil(
&executionStart,
pdMS_TO_TICKS(PowerParameters::POWER_STATE_UPDATE_INTERVAL_MS));
}
}