From 5117c1292d7bc1fa4651e6fa6e70b557f29812e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=B6ller?= Date: Sun, 4 Aug 2013 06:54:46 +0000 Subject: [PATCH] Fixed an issue in the NCT677X class causing a crash when calling Update. --- Hardware/LPC/NCT677X.cs | 13 ++++++++++++- Properties/AssemblyVersion.cs | 4 ++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Hardware/LPC/NCT677X.cs b/Hardware/LPC/NCT677X.cs index 81333bc..4c63ed8 100644 --- a/Hardware/LPC/NCT677X.cs +++ b/Hardware/LPC/NCT677X.cs @@ -20,6 +20,8 @@ namespace OpenHardwareMonitor.Hardware.LPC { private readonly Chip chip; + private readonly bool isNuvotonVendor; + private readonly float?[] voltages = new float?[0]; private readonly float?[] temperatures = new float?[0]; private readonly float?[] fans = new float?[0]; @@ -162,7 +164,10 @@ namespace OpenHardwareMonitor.Hardware.LPC { this.revision = revision; this.port = port; - if (!IsNuvotonVendor()) + + this.isNuvotonVendor = IsNuvotonVendor(); + + if (!isNuvotonVendor) return; switch (chip) { @@ -293,6 +298,9 @@ namespace OpenHardwareMonitor.Hardware.LPC { } public void SetControl(int index, byte? value) { + if (!isNuvotonVendor) + return; + if (index < 0 || index >= controls.Length) throw new ArgumentOutOfRangeException("index"); @@ -321,6 +329,9 @@ namespace OpenHardwareMonitor.Hardware.LPC { public float?[] Controls { get { return controls; } } public void Update() { + if (!isNuvotonVendor) + return; + if (!Ring0.WaitIsaBusMutex(10)) return; diff --git a/Properties/AssemblyVersion.cs b/Properties/AssemblyVersion.cs index f30da71..cee782b 100644 --- a/Properties/AssemblyVersion.cs +++ b/Properties/AssemblyVersion.cs @@ -10,5 +10,5 @@ using System.Reflection; -[assembly: AssemblyVersion("0.6.0.6")] -[assembly: AssemblyInformationalVersion("0.6.0.6 Alpha")] \ No newline at end of file +[assembly: AssemblyVersion("0.6.0.7")] +[assembly: AssemblyInformationalVersion("0.6.0.7 Alpha")] \ No newline at end of file