Added option to keep dGPU off on usb-c

This commit is contained in:
Serge
2023-05-03 16:49:12 +02:00
parent 0ec0a382e9
commit 5ed1de0fcf
14 changed files with 244 additions and 133 deletions

View File

@@ -124,22 +124,22 @@ public static class HardwareMonitor
return false;
}
public static void RecreateGpuTemperatureProviderWithDelay()
public static void RecreateGpuControlWithDelay(int delay = 5)
{
// Re-enabling the discrete GPU takes a bit of time,
// so a simple workaround is to refresh again after that happens
Task.Run(async () =>
{
await Task.Delay(TimeSpan.FromSeconds(5));
RecreateGpuTemperatureProvider();
await Task.Delay(TimeSpan.FromSeconds(delay));
RecreateGpuControl();
});
}
public static void RecreateGpuTemperatureProvider()
public static void RecreateGpuControl()
{
try
{