1
Fork 0
mirror of https://github.com/RGBCube/superfreq synced 2025-07-27 17:07:44 +00:00

engine: maintain previous state when CPU data is missing

This commit is contained in:
NotAShelf 2025-05-18 03:19:09 +03:00
parent c570a327ab
commit 72c2842227
No known key found for this signature in database
GPG key ID: 29D95B64378DB4BF

View file

@ -369,15 +369,25 @@ fn manage_auto_turbo(report: &SystemReport, config: &ProfileConfig) -> Result<()
} }
// In indeterminate states or unknown previous state, use the configured initial state // In indeterminate states or unknown previous state, use the configured initial state
_ => { _ => {
info!( // If we have a previous state, maintain it for hysteresis even if load data is missing
"Auto Turbo: Using configured initial state ({})", if let Some(prev_state) = previous_turbo_enabled {
if turbo_settings.initial_turbo_state { info!(
"enabled" "Auto Turbo: Maintaining previous state ({}) due to missing CPU data",
} else { if prev_state { "enabled" } else { "disabled" }
"disabled" );
} prev_state
); } else {
turbo_settings.initial_turbo_state // No previous state exists, fall back to configured initial state
info!(
"Auto Turbo: Using configured initial state ({})",
if turbo_settings.initial_turbo_state {
"enabled"
} else {
"disabled"
}
);
turbo_settings.initial_turbo_state
}
} }
}; };