File tree Expand file tree Collapse file tree 1 file changed +33
-14
lines changed
Expand file tree Collapse file tree 1 file changed +33
-14
lines changed Original file line number Diff line number Diff line change @@ -420,22 +420,41 @@ fn manage_auto_turbo(
420420 hysteresis. update_state ( enable_turbo) ;
421421 }
422422
423- // Apply the turbo setting
424- let turbo_setting = if enable_turbo {
425- TurboSetting :: Always
426- } else {
427- TurboSetting :: Never
428- } ;
423+ // Only apply the setting if the state has changed
424+ let changed = previous_turbo_enabled != enable_turbo;
425+ if changed {
426+ let turbo_setting = if enable_turbo {
427+ TurboSetting :: Always
428+ } else {
429+ TurboSetting :: Never
430+ } ;
429431
430- match cpu:: set_turbo ( turbo_setting) {
431- Ok ( ( ) ) => {
432- debug ! (
433- "Auto Turbo: Successfully set turbo to {}" ,
434- if enable_turbo { "enabled" } else { "disabled" }
435- ) ;
436- Ok ( ( ) )
432+ info ! (
433+ "Auto Turbo: Applying turbo change from {} to {}" ,
434+ if previous_turbo_enabled {
435+ "enabled"
436+ } else {
437+ "disabled"
438+ } ,
439+ if enable_turbo { "enabled" } else { "disabled" }
440+ ) ;
441+
442+ match cpu:: set_turbo ( turbo_setting) {
443+ Ok ( ( ) ) => {
444+ debug ! (
445+ "Auto Turbo: Successfully set turbo to {}" ,
446+ if enable_turbo { "enabled" } else { "disabled" }
447+ ) ;
448+ Ok ( ( ) )
449+ }
450+ Err ( e) => Err ( EngineError :: ControlError ( e) ) ,
437451 }
438- Err ( e) => Err ( EngineError :: ControlError ( e) ) ,
452+ } else {
453+ debug ! (
454+ "Auto Turbo: Maintaining turbo state ({}) - no change needed" ,
455+ if enable_turbo { "enabled" } else { "disabled" }
456+ ) ;
457+ Ok ( ( ) )
439458 }
440459}
441460
You can’t perform that action at this time.
0 commit comments