mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Cleanup
This commit is contained in:
@@ -28,7 +28,7 @@ namespace GHelper.Mode
|
|||||||
|
|
||||||
private void ReapplyTimer_Elapsed(object? sender, System.Timers.ElapsedEventArgs e)
|
private void ReapplyTimer_Elapsed(object? sender, System.Timers.ElapsedEventArgs e)
|
||||||
{
|
{
|
||||||
SetCPUTemp(AppConfig.GetMode("cpu_temp"), false);
|
SetCPUTemp(AppConfig.GetMode("cpu_temp"));
|
||||||
SetRyzenPower();
|
SetRyzenPower();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -369,18 +369,16 @@ namespace GHelper.Mode
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetCPUTemp(int? cpuTemp, bool log = true)
|
public void SetCPUTemp(int? cpuTemp, bool init = false)
|
||||||
{
|
{
|
||||||
if (cpuTemp >= RyzenControl.MinTemp && cpuTemp < RyzenControl.MaxTemp)
|
if (cpuTemp >= RyzenControl.MinTemp && cpuTemp < RyzenControl.MaxTemp)
|
||||||
{
|
{
|
||||||
var resultCPU = SendCommand.set_tctl_temp((uint)cpuTemp);
|
var resultCPU = SendCommand.set_tctl_temp((uint)cpuTemp);
|
||||||
if (log) Logger.WriteLine($"CPU Temp: {cpuTemp} {resultCPU}");
|
if (init) Logger.WriteLine($"CPU Temp: {cpuTemp} {resultCPU}");
|
||||||
|
|
||||||
var restultAPU = SendCommand.set_apu_skin_temp_limit((uint)cpuTemp);
|
var restultAPU = SendCommand.set_apu_skin_temp_limit((uint)cpuTemp);
|
||||||
if (log) Logger.WriteLine($"APU Temp: {cpuTemp} {restultAPU}");
|
if (init) Logger.WriteLine($"APU Temp: {cpuTemp} {restultAPU}");
|
||||||
}
|
}
|
||||||
|
|
||||||
reapplyTimer.Enabled = AppConfig.IsMode("auto_uv");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetUV(int cpuUV)
|
public void SetUV(int cpuUV)
|
||||||
@@ -422,18 +420,21 @@ namespace GHelper.Mode
|
|||||||
{
|
{
|
||||||
SetUV(AppConfig.GetMode("cpu_uv", 0));
|
SetUV(AppConfig.GetMode("cpu_uv", 0));
|
||||||
SetUViGPU(AppConfig.GetMode("igpu_uv", 0));
|
SetUViGPU(AppConfig.GetMode("igpu_uv", 0));
|
||||||
SetCPUTemp(AppConfig.GetMode("cpu_temp"));
|
SetCPUTemp(AppConfig.GetMode("cpu_temp"), true);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Logger.WriteLine("UV Error: " + ex.ToString());
|
Logger.WriteLine("UV Error: " + ex.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reapplyTimer.Enabled = AppConfig.IsMode("auto_uv");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ResetRyzen()
|
public void ResetRyzen()
|
||||||
{
|
{
|
||||||
if (_cpuUV != 0) SetUV(0);
|
if (_cpuUV != 0) SetUV(0);
|
||||||
if (_igpuUV != 0) SetUViGPU(0);
|
if (_igpuUV != 0) SetUViGPU(0);
|
||||||
|
reapplyTimer.Enabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AutoRyzen()
|
public void AutoRyzen()
|
||||||
|
|||||||
Reference in New Issue
Block a user