1
Fork 0
mirror of https://github.com/RGBCube/superfreq synced 2025-07-28 01:17:45 +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,6 +369,15 @@ 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
_ => { _ => {
// If we have a previous state, maintain it for hysteresis even if load data is missing
if let Some(prev_state) = previous_turbo_enabled {
info!(
"Auto Turbo: Maintaining previous state ({}) due to missing CPU data",
if prev_state { "enabled" } else { "disabled" }
);
prev_state
} else {
// No previous state exists, fall back to configured initial state
info!( info!(
"Auto Turbo: Using configured initial state ({})", "Auto Turbo: Using configured initial state ({})",
if turbo_settings.initial_turbo_state { if turbo_settings.initial_turbo_state {
@ -379,6 +388,7 @@ fn manage_auto_turbo(report: &SystemReport, config: &ProfileConfig) -> Result<()
); );
turbo_settings.initial_turbo_state turbo_settings.initial_turbo_state
} }
}
}; };
// Save the current state for next time // Save the current state for next time