mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Use watts as double to have more fine grained control
This commit is contained in:
@@ -379,7 +379,7 @@ namespace GHelper.AutoTDP
|
||||
Logger.WriteLine("[AutoTDPService] Setting Power Limit from " + CurrentTDP + "W to " + newPL + "W, Delta:" + adjustment);
|
||||
|
||||
//We only limit to full watts, no fractions. In this case, we will cut off the fractional part
|
||||
powerLimiter.SetCPUPowerLimit((int)newPL);
|
||||
powerLimiter.SetCPUPowerLimit(newPL);
|
||||
CurrentTDP = newPL;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,17 +21,17 @@ namespace GHelper.AutoTDP.PowerLimiter
|
||||
}
|
||||
}
|
||||
|
||||
public void SetCPUPowerLimit(int watts)
|
||||
public void SetCPUPowerLimit(double watts)
|
||||
{
|
||||
if (Program.acpi.DeviceGet(AsusACPI.PPT_APUA0) >= 0)
|
||||
{
|
||||
Program.acpi.DeviceSet(AsusACPI.PPT_APUA3, watts, "PowerLimit A3");
|
||||
Program.acpi.DeviceSet(AsusACPI.PPT_APUA0, watts, "PowerLimit A0");
|
||||
Program.acpi.DeviceSet(AsusACPI.PPT_APUA3, (int)watts, "PowerLimit A3");
|
||||
Program.acpi.DeviceSet(AsusACPI.PPT_APUA0, (int)watts, "PowerLimit A0");
|
||||
}
|
||||
|
||||
if (Program.acpi.IsAllAmdPPT()) // CPU limit all amd models
|
||||
{
|
||||
Program.acpi.DeviceSet(AsusACPI.PPT_CPUB0, watts, "PowerLimit B0");
|
||||
Program.acpi.DeviceSet(AsusACPI.PPT_CPUB0, (int)watts, "PowerLimit B0");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
internal interface IPowerLimiter : IDisposable
|
||||
{
|
||||
public void SetCPUPowerLimit(int watts);
|
||||
public void SetCPUPowerLimit(double watts);
|
||||
|
||||
public int GetCPUPowerLimit();
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace GHelper.AutoTDP.PowerLimiter
|
||||
PowerUnit = 1 / Math.Pow(2, pwr);
|
||||
}
|
||||
|
||||
public void SetCPUPowerLimit(int watts)
|
||||
public void SetCPUPowerLimit(double watts)
|
||||
{
|
||||
uint eax = 0;
|
||||
uint edx = 0;
|
||||
|
||||
Reference in New Issue
Block a user