From f545d48179c0a490947783c01c0bf296bf2402e5 Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Sat, 19 Aug 2023 12:40:30 +0200 Subject: [PATCH] GPU detection https://github.com/seerge/g-helper/issues/1114 Resetting custom fan curve on XGM on disconnect https://github.com/seerge/g-helper/issues/1123 --- app/Gpu/GPUModeControl.cs | 4 ++++ app/HardwareControl.cs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Gpu/GPUModeControl.cs b/app/Gpu/GPUModeControl.cs index 95333314..4e3b4cd4 100644 --- a/app/Gpu/GPUModeControl.cs +++ b/app/Gpu/GPUModeControl.cs @@ -285,7 +285,9 @@ namespace GHelper.Gpu if (Program.acpi.DeviceGet(AsusACPI.GPUXG) == 1) { + AsusUSB.ResetXGM(); HardwareControl.KillGPUApps(); + DialogResult dialogResult = MessageBox.Show("Did you close all applications running on XG Mobile?", "Disabling XG Mobile", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { @@ -296,6 +298,8 @@ namespace GHelper.Gpu else { Program.acpi.DeviceSet(AsusACPI.GPUXG, 1, "GPU XGM"); + + AsusUSB.ResetXGM(); AsusUSB.ApplyXGMLight(AppConfig.Is("xmg_light")); await Task.Delay(TimeSpan.FromSeconds(15)); diff --git a/app/HardwareControl.cs b/app/HardwareControl.cs index 0d89898b..f513319a 100644 --- a/app/HardwareControl.cs +++ b/app/HardwareControl.cs @@ -83,7 +83,7 @@ public static class HardwareControl if (fan < 0) { 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;