mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
ASUS power limiter fixes
This commit is contained in:
@@ -7,8 +7,19 @@ namespace GHelper.AutoTDP.PowerLimiter
|
|||||||
internal class ASUSACPIPowerLimiter : IPowerLimiter
|
internal class ASUSACPIPowerLimiter : IPowerLimiter
|
||||||
{
|
{
|
||||||
|
|
||||||
private int DefaultA0 = Program.acpi.DeviceGet(AsusACPI.PPT_APUA0);
|
private int DefaultA0;
|
||||||
private int DefaultA3 = Program.acpi.DeviceGet(AsusACPI.PPT_APUA0);
|
private int DefaultA3;
|
||||||
|
private int DefaultB0 = 0;
|
||||||
|
|
||||||
|
public ASUSACPIPowerLimiter()
|
||||||
|
{
|
||||||
|
DefaultA0 = Program.acpi.DeviceGet(AsusACPI.PPT_APUA0);
|
||||||
|
DefaultA3 = Program.acpi.DeviceGet(AsusACPI.PPT_APUA3);
|
||||||
|
if (Program.acpi.IsAllAmdPPT()) // CPU limit all amd models
|
||||||
|
{
|
||||||
|
DefaultB0 = Program.acpi.DeviceGet(AsusACPI.PPT_CPUB0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void SetCPUPowerLimit(int watts)
|
public void SetCPUPowerLimit(int watts)
|
||||||
{
|
{
|
||||||
@@ -17,6 +28,11 @@ namespace GHelper.AutoTDP.PowerLimiter
|
|||||||
Program.acpi.DeviceSet(AsusACPI.PPT_APUA3, watts, "PowerLimit A3");
|
Program.acpi.DeviceSet(AsusACPI.PPT_APUA3, watts, "PowerLimit A3");
|
||||||
Program.acpi.DeviceSet(AsusACPI.PPT_APUA0, watts, "PowerLimit A0");
|
Program.acpi.DeviceSet(AsusACPI.PPT_APUA0, watts, "PowerLimit A0");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Program.acpi.IsAllAmdPPT()) // CPU limit all amd models
|
||||||
|
{
|
||||||
|
Program.acpi.DeviceSet(AsusACPI.PPT_CPUB0, watts, "PowerLimit B0");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -33,8 +49,16 @@ namespace GHelper.AutoTDP.PowerLimiter
|
|||||||
public void ResetPowerLimits()
|
public void ResetPowerLimits()
|
||||||
{
|
{
|
||||||
//Load limits that were set before the limiter engaged
|
//Load limits that were set before the limiter engaged
|
||||||
Program.acpi.DeviceSet(AsusACPI.PPT_APUA3, DefaultA0, "PowerLimit A3");
|
if (DefaultA3 > 0)
|
||||||
Program.acpi.DeviceSet(AsusACPI.PPT_APUA0, DefaultA3, "PowerLimit A0");
|
Program.acpi.DeviceSet(AsusACPI.PPT_APUA3, DefaultA3, "PowerLimit A0");
|
||||||
|
|
||||||
|
if (DefaultA0 > 0)
|
||||||
|
Program.acpi.DeviceSet(AsusACPI.PPT_APUA0, DefaultA0, "PowerLimit A3");
|
||||||
|
|
||||||
|
if (Program.acpi.IsAllAmdPPT() && DefaultB0 > 0) // CPU limit all amd models
|
||||||
|
{
|
||||||
|
Program.acpi.DeviceSet(AsusACPI.PPT_CPUB0, DefaultB0, "PowerLimit B0");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user