From 8b5a349bb0de2f8caeb2d63065fbc0c3149c231f Mon Sep 17 00:00:00 2001 From: terratec <989319+terratec@users.noreply.github.com> Date: Sat, 7 Dec 2024 12:48:46 +0100 Subject: [PATCH] Add fall back to automatic fan speed --- main/tasks/power_management_task.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main/tasks/power_management_task.c b/main/tasks/power_management_task.c index 5ff8f79f..4506028c 100644 --- a/main/tasks/power_management_task.c +++ b/main/tasks/power_management_task.c @@ -16,6 +16,7 @@ #define POLL_RATE 2000 #define MAX_TEMP 90.0 #define THROTTLE_TEMP 75.0 +#define HOT_TEMP 70.0 #define THROTTLE_TEMP_RANGE (MAX_TEMP - THROTTLE_TEMP) #define VOLTAGE_START_THROTTLE 4900 @@ -255,6 +256,11 @@ void POWER_MANAGEMENT_task(void * pvParameters) case DEVICE_GAMMA: float fs = (float) nvs_config_get_u16(NVS_CONFIG_FAN_SPEED, 100); + if ((HOT_TEMP < power_management->chip_temp_avg) && (90.0 > fs)) { + // (non-persistent) fall back to automatic fan speed if the manual speed is below 90% + auto_fan_speed = 1; + fs = 90.0; + } power_management->fan_perc = fs; EMC2101_set_fan_speed((float) fs / 100);