mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Fan ranges for ancient devices https://github.com/seerge/g-helper/issues/1206
This commit is contained in:
@@ -67,6 +67,9 @@ public class AsusACPI
|
|||||||
public const uint ScreenOverdrive = 0x00050019;
|
public const uint ScreenOverdrive = 0x00050019;
|
||||||
public const uint ScreenMiniled = 0x0005001E;
|
public const uint ScreenMiniled = 0x0005001E;
|
||||||
|
|
||||||
|
public const uint DevsCPUFan = 0x00110022;
|
||||||
|
public const uint DevsGPUFan = 0x00110023;
|
||||||
|
|
||||||
public const uint DevsCPUFanCurve = 0x00110024;
|
public const uint DevsCPUFanCurve = 0x00110024;
|
||||||
public const uint DevsGPUFanCurve = 0x00110025;
|
public const uint DevsGPUFanCurve = 0x00110025;
|
||||||
public const uint DevsMidFanCurve = 0x00110032;
|
public const uint DevsMidFanCurve = 0x00110032;
|
||||||
@@ -336,6 +339,25 @@ public class AsusACPI
|
|||||||
return -1;
|
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)
|
public int SetFanCurve(AsusFan device, byte[] curve)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public static class HardwareControl
|
|||||||
if (_fanMax < 0 && AppConfig.ContainsModel("503")) _fanMax = 68;
|
if (_fanMax < 0 && AppConfig.ContainsModel("503")) _fanMax = 68;
|
||||||
if (_fanMax < 0) _fanMax = DEFAULT_FAN_MAX;
|
if (_fanMax < 0) _fanMax = DEFAULT_FAN_MAX;
|
||||||
|
|
||||||
_fanRpm = AppConfig.Is("fan_rpm");
|
_fanRpm = AppConfig.IsNotFalse("fan_rpm");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -148,10 +148,16 @@ namespace GHelper.Mode
|
|||||||
// something went wrong, resetting to default profile
|
// something went wrong, resetting to default profile
|
||||||
if (cpuResult != 1 || gpuResult != 1)
|
if (cpuResult != 1 || gpuResult != 1)
|
||||||
{
|
{
|
||||||
int mode = Modes.GetCurrentBase();
|
cpuResult = Program.acpi.SetFanRange(AsusFan.CPU, AppConfig.GetFanConfig(AsusFan.CPU));
|
||||||
Logger.WriteLine("ASUS BIOS rejected fan curve, resetting mode to " + mode);
|
gpuResult = Program.acpi.SetFanRange(AsusFan.GPU, AppConfig.GetFanConfig(AsusFan.GPU));
|
||||||
Program.acpi.DeviceSet(AsusACPI.PerformanceMode, mode, "Reset Mode");
|
|
||||||
settings.LabelFansResult("ASUS BIOS rejected fan curve");
|
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
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user