mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Fix for FX507 models
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using System.Management;
|
using System.Diagnostics;
|
||||||
|
using System.Management;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
|
|
||||||
public class AppConfig
|
public class AppConfig
|
||||||
@@ -91,14 +92,27 @@ public class AppConfig
|
|||||||
{
|
{
|
||||||
config[name] = value;
|
config[name] = value;
|
||||||
string jsonString = JsonSerializer.Serialize(config, new JsonSerializerOptions { WriteIndented = true });
|
string jsonString = JsonSerializer.Serialize(config, new JsonSerializerOptions { WriteIndented = true });
|
||||||
File.WriteAllText(configFile, jsonString);
|
try
|
||||||
|
{
|
||||||
|
File.WriteAllText(configFile, jsonString);
|
||||||
|
} catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Write(e.ToString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setConfig(string name, string value)
|
public void setConfig(string name, string value)
|
||||||
{
|
{
|
||||||
config[name] = value;
|
config[name] = value;
|
||||||
string jsonString = JsonSerializer.Serialize(config, new JsonSerializerOptions { WriteIndented = true });
|
string jsonString = JsonSerializer.Serialize(config, new JsonSerializerOptions { WriteIndented = true });
|
||||||
File.WriteAllText(configFile, jsonString);
|
try
|
||||||
|
{
|
||||||
|
File.WriteAllText(configFile, jsonString);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Write(e.ToString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public string getParamName(int device, string paramName = "fan_profile")
|
public string getParamName(int device, string paramName = "fan_profile")
|
||||||
|
|||||||
@@ -907,13 +907,25 @@ namespace GHelper
|
|||||||
if (Program.config.getConfig("mid_fan") == 1)
|
if (Program.config.getConfig("mid_fan") == 1)
|
||||||
Program.wmi.SetFanCurve(2, Program.config.getFanConfig(2));
|
Program.wmi.SetFanCurve(2, Program.config.getFanConfig(2));
|
||||||
|
|
||||||
if (cpuResult != 1 || gpuResult != 1) // something went wrong, resetting to default profile
|
// something went wrong, resetting to default profile
|
||||||
|
if (cpuResult != 1 || gpuResult != 1)
|
||||||
{
|
{
|
||||||
int mode = Program.config.getConfig("performance_mode");
|
int mode = Program.config.getConfig("performance_mode");
|
||||||
Logger.WriteLine("Driver rejected fan curve, resetting mode to " + mode);
|
Logger.WriteLine("Driver rejected fan curve, resetting mode to " + mode);
|
||||||
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, mode, "PerformanceMode");
|
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, mode, "PerformanceMode");
|
||||||
}
|
}
|
||||||
else customFans = true;
|
else customFans = true;
|
||||||
|
|
||||||
|
// fix for misbehaving bios on intell based TUF 2022
|
||||||
|
if (Program.config.ContainsModel("FX507") && Program.config.getConfigPerf("auto_apply_power") != 1)
|
||||||
|
{
|
||||||
|
Task.Run(async () =>
|
||||||
|
{
|
||||||
|
await Task.Delay(TimeSpan.FromSeconds(1));
|
||||||
|
Program.wmi.DeviceSet(ASUSWmi.PPT_TotalA0, 80, "PowerLimit Fix");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Program.settingsForm.BeginInvoke(SetPerformanceLabel);
|
Program.settingsForm.BeginInvoke(SetPerformanceLabel);
|
||||||
|
|||||||
Reference in New Issue
Block a user