Resetting custom fan curve on XGM on disconnect https://github.com/seerge/g-helper/issues/1123
This commit is contained in:
Serge
2023-08-19 12:40:30 +02:00
parent e2596ed9cb
commit f545d48179
2 changed files with 5 additions and 1 deletions

View File

@@ -285,7 +285,9 @@ namespace GHelper.Gpu
if (Program.acpi.DeviceGet(AsusACPI.GPUXG) == 1) if (Program.acpi.DeviceGet(AsusACPI.GPUXG) == 1)
{ {
AsusUSB.ResetXGM();
HardwareControl.KillGPUApps(); HardwareControl.KillGPUApps();
DialogResult dialogResult = MessageBox.Show("Did you close all applications running on XG Mobile?", "Disabling XG Mobile", MessageBoxButtons.YesNo); DialogResult dialogResult = MessageBox.Show("Did you close all applications running on XG Mobile?", "Disabling XG Mobile", MessageBoxButtons.YesNo);
if (dialogResult == DialogResult.Yes) if (dialogResult == DialogResult.Yes)
{ {
@@ -296,6 +298,8 @@ namespace GHelper.Gpu
else else
{ {
Program.acpi.DeviceSet(AsusACPI.GPUXG, 1, "GPU XGM"); Program.acpi.DeviceSet(AsusACPI.GPUXG, 1, "GPU XGM");
AsusUSB.ResetXGM();
AsusUSB.ApplyXGMLight(AppConfig.Is("xmg_light")); AsusUSB.ApplyXGMLight(AppConfig.Is("xmg_light"));
await Task.Delay(TimeSpan.FromSeconds(15)); await Task.Delay(TimeSpan.FromSeconds(15));

View File

@@ -83,7 +83,7 @@ public static class HardwareControl
if (fan < 0) if (fan < 0)
{ {
fan += 65536; fan += 65536;
if (fan <= 0 || fan > 100) return null; //nothing reasonable if (fan < 0 || fan > 100) return null; //nothing reasonable
} }
if (fan > fanMax && fan <= INADEQUATE_MAX) fanMax = fan; if (fan > fanMax && fan <= INADEQUATE_MAX) fanMax = fan;