Skip to content

Commit

Permalink
PerformanceManager: use degraded interval if RTSS doesn't have a hook (
Browse files Browse the repository at this point in the history
…#367)

Keeps us from applying default TDP once a second when no hook is present.
  • Loading branch information
romracer authored Oct 26, 2024
1 parent 0d0173a commit c784f67
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion HandheldCompanion/Managers/PerformanceManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,12 @@ private static void autotdpWatchdog_Elapsed(object? sender, ElapsedEventArgs e)

if (!PlatformManager.RTSS.HasHook())
{
autotdpWatchdog.Interval = INTERVAL_DEGRADED;
RestoreTDP(true);
return;
}
else
autotdpWatchdog.Interval = INTERVAL_AUTO;

if (autotdpLock.TryEnter())
{
Expand Down Expand Up @@ -433,8 +436,17 @@ private static void autotdpWatchdog_Elapsed(object? sender, ElapsedEventArgs e)

// user requested to halt AutoTDP watchdog
if (autotdpWatchdogPendingStop)
if (TDPdone && MSRdone)
{
if (autotdpWatchdog.Interval == INTERVAL_AUTO)
{
if (TDPdone && MSRdone)
autotdpWatchdog.Stop();
}
else if (autotdpWatchdog.Interval == INTERVAL_DEGRADED)
{
autotdpWatchdog.Stop();
}
}
}
finally
{
Expand Down

0 comments on commit c784f67

Please sign in to comment.