From a31303624aca9779f9fc98b339d1451c6113d024 Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Sun, 16 Jul 2023 17:04:15 +0200 Subject: [PATCH] Removed Undervolting sliders for not supported models --- app/Fans.cs | 10 ++++++++++ app/Mode/ModeControl.cs | 4 ++++ app/Ryzen/RyzenControl.cs | 10 ++++++++-- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/app/Fans.cs b/app/Fans.cs index ef1fa6e6..6470c994 100644 --- a/app/Fans.cs +++ b/app/Fans.cs @@ -285,6 +285,16 @@ namespace GHelper private void VisualiseAdvanced() { + if (!RyzenControl.IsSupportedUV()) + { + panelUV.Visible = panelUViGPU.Visible = false; + } + + if (!RyzenControl.IsSupportedUV()) + { + panelUViGPU.Visible = false; + } + labelUV.Text = trackUV.Value.ToString(); labelUViGPU.Text = trackUViGPU.Value.ToString(); labelTemp.Text = (trackTemp.Value < RyzenControl.MaxTemp) ? trackTemp.Value.ToString() + "°C" : "Default"; diff --git a/app/Mode/ModeControl.cs b/app/Mode/ModeControl.cs index 1dc822fe..fe4b5db9 100644 --- a/app/Mode/ModeControl.cs +++ b/app/Mode/ModeControl.cs @@ -366,6 +366,8 @@ namespace GHelper.Mode public void SetUV(int cpuUV) { + if (!RyzenControl.IsSupportedUV()) return; + if (cpuUV >= RyzenControl.MinCPUUV && cpuUV <= RyzenControl.MaxCPUUV) { var uvResult = SendCommand.set_coall(cpuUV); @@ -376,6 +378,8 @@ namespace GHelper.Mode public void SetUViGPU(int igpuUV) { + if (!RyzenControl.IsSupportedUViGPU()) return; + if (igpuUV >= RyzenControl.MinIGPUUV && igpuUV <= RyzenControl.MaxIGPUUV) { var iGPUResult = SendCommand.set_cogfx(igpuUV); diff --git a/app/Ryzen/RyzenControl.cs b/app/Ryzen/RyzenControl.cs index 0e942809..8f0cfdaa 100644 --- a/app/Ryzen/RyzenControl.cs +++ b/app/Ryzen/RyzenControl.cs @@ -130,10 +130,16 @@ namespace Ryzen return CPUName.Contains("AMD") || CPUName.Contains("Ryzen") || CPUName.Contains("Athlon") || CPUName.Contains("Radeon") || CPUName.Contains("AMD Custom APU 0405"); } - public static bool IsRyzen9() + public static bool IsSupportedUV() { if (CPUName.Length == 0) Init(); - return CPUName.Contains("Ryzen 9"); + return CPUName.Contains("Ryzen 9") || CPUName.Contains("4900H") || CPUName.Contains("4800H") || CPUName.Contains("4600H"); + } + + public static bool IsSupportedUViGPU() + { + if (CPUName.Length == 0) Init(); + return CPUName.Contains("6900H") || CPUName.Contains("7945H") || CPUName.Contains("7845H"); } public static void SetAddresses()