Better logic to handle availability of tdp limiters

This commit is contained in:
IceStormNG
2024-03-02 13:29:56 +01:00
parent b104d852c7
commit f2ef77b866
4 changed files with 18 additions and 6 deletions

View File

@@ -1,4 +1,5 @@
using GHelper.AutoTDP.FramerateSource;
using GHelper.AutoTDP.PowerLimiter;
using GHelper.UI;
using Ryzen;
@@ -123,7 +124,7 @@ namespace GHelper.AutoTDP
{
checkBoxEnabled.Checked = AppConfig.Get("auto_tdp_enabled", 0) == 1;
if (!RyzenControl.IsAMD())
if (IntelMSRPowerLimiter.IsAvailable())
comboBoxLimiter.Items.Add("Intel MSR Power Limiter");
@@ -134,14 +135,14 @@ namespace GHelper.AutoTDP
if (comboBoxLimiter.Items.Count > 0 && limiter is null)
comboBoxLimiter.SelectedIndex = 0;
if (!RyzenControl.IsAMD() && limiter is not null && limiter.Equals("intel_msr"))
if (IntelMSRPowerLimiter.IsAvailable() && limiter is not null && limiter.Equals("intel_msr"))
{
comboBoxLimiter.SelectedIndex = 0;
}
if (limiter is not null && limiter.Equals("asus_acpi"))
if (limiter is not null && limiter.Equals("asus_acpi") && ASUSACPIPowerLimiter.IsAvailable())
{
comboBoxLimiter.SelectedIndex = !RyzenControl.IsAMD() ? 1 : 0;
comboBoxLimiter.SelectedIndex = IntelMSRPowerLimiter.IsAvailable() ? 1 : 0;
}