diff --git a/app/AsusACPI.cs b/app/AsusACPI.cs index c9395adf..5510485a 100644 --- a/app/AsusACPI.cs +++ b/app/AsusACPI.cs @@ -67,6 +67,9 @@ public class AsusACPI public const uint ScreenOverdrive = 0x00050019; public const uint ScreenMiniled = 0x0005001E; + public const uint DevsCPUFan = 0x00110022; + public const uint DevsGPUFan = 0x00110023; + public const uint DevsCPUFanCurve = 0x00110024; public const uint DevsGPUFanCurve = 0x00110025; public const uint DevsMidFanCurve = 0x00110032; @@ -336,6 +339,25 @@ public class AsusACPI return -1; } + public int SetFanRange(AsusFan device, byte[] curve) + { + byte min = (byte)(curve[8] * 255 / 100); + byte max = (byte)(curve[15] * 255 / 100); + byte[] range = { min, max}; + + int result; + switch (device) + { + case AsusFan.GPU: + result = DeviceSet(DevsGPUFan, range, "FanRangeGPU"); + break; + default: + result = DeviceSet(DevsCPUFan, range, "FanRangeCPU"); + break; + } + return result; + } + public int SetFanCurve(AsusFan device, byte[] curve) { diff --git a/app/HardwareControl.cs b/app/HardwareControl.cs index 0d89898b..a6720d6c 100644 --- a/app/HardwareControl.cs +++ b/app/HardwareControl.cs @@ -73,7 +73,7 @@ public static class HardwareControl if (_fanMax < 0 && AppConfig.ContainsModel("503")) _fanMax = 68; if (_fanMax < 0) _fanMax = DEFAULT_FAN_MAX; - _fanRpm = AppConfig.Is("fan_rpm"); + _fanRpm = AppConfig.IsNotFalse("fan_rpm"); } diff --git a/app/Mode/ModeControl.cs b/app/Mode/ModeControl.cs index a1a3b1c5..0cdb8410 100644 --- a/app/Mode/ModeControl.cs +++ b/app/Mode/ModeControl.cs @@ -148,10 +148,16 @@ namespace GHelper.Mode // something went wrong, resetting to default profile if (cpuResult != 1 || gpuResult != 1) { - int mode = Modes.GetCurrentBase(); - Logger.WriteLine("ASUS BIOS rejected fan curve, resetting mode to " + mode); - Program.acpi.DeviceSet(AsusACPI.PerformanceMode, mode, "Reset Mode"); - settings.LabelFansResult("ASUS BIOS rejected fan curve"); + cpuResult = Program.acpi.SetFanRange(AsusFan.CPU, AppConfig.GetFanConfig(AsusFan.CPU)); + gpuResult = Program.acpi.SetFanRange(AsusFan.GPU, AppConfig.GetFanConfig(AsusFan.GPU)); + + if (cpuResult != 1 || gpuResult != 1) + { + int mode = Modes.GetCurrentBase(); + Logger.WriteLine("ASUS BIOS rejected fan curve, resetting mode to " + mode); + Program.acpi.DeviceSet(AsusACPI.PerformanceMode, mode, "Reset Mode"); + settings.LabelFansResult("ASUS BIOS rejected fan curve"); + } } else {