mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Added AutoTDP feature with RTSS source and Intel + ASUS power limiters
This commit is contained in:
42
app/AutoTDP/PowerLimiter/ASUSACPIPowerLimiter.cs
Normal file
42
app/AutoTDP/PowerLimiter/ASUSACPIPowerLimiter.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GHelper.AutoTDP.PowerLimiter
|
||||
{
|
||||
internal class ASUSACPIPowerLimiter : IPowerLimiter
|
||||
{
|
||||
|
||||
private int DefaultA0 = Program.acpi.DeviceGet(AsusACPI.PPT_APUA0);
|
||||
private int DefaultA3 = Program.acpi.DeviceGet(AsusACPI.PPT_APUA0);
|
||||
|
||||
public void SetCPUPowerLimit(int 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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public int GetCPUPowerLimit()
|
||||
{
|
||||
return Program.acpi.DeviceGet(AsusACPI.PPT_APUA0);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
//Nothing to dispose here
|
||||
}
|
||||
|
||||
public void ResetPowerLimits()
|
||||
{
|
||||
//Load limits that were set before the limiter engaged
|
||||
Program.acpi.DeviceSet(AsusACPI.PPT_APUA3, DefaultA0, "PowerLimit A3");
|
||||
Program.acpi.DeviceSet(AsusACPI.PPT_APUA0, DefaultA3, "PowerLimit A0");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user