From 1157a33042579159322a68a0d9c59f7e6b01dcd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=B6ller?= Date: Sat, 19 Mar 2011 22:55:05 +0000 Subject: [PATCH] Fixed Issue 156. --- GUI/MainForm.cs | 2 +- Hardware/LPC/Chip.cs | 4 +- Hardware/LPC/LPCIO.cs | 10 +++- Hardware/LPC/NCT677X.cs | 28 ++++++++-- Hardware/Mainboard/Model.cs | 3 +- Hardware/Mainboard/SMBIOS.cs | 4 +- Hardware/Mainboard/SuperIOHardware.cs | 76 +++++++++++++++++++++------ 7 files changed, 100 insertions(+), 27 deletions(-) diff --git a/GUI/MainForm.cs b/GUI/MainForm.cs index 0421cda..183ee23 100644 --- a/GUI/MainForm.cs +++ b/GUI/MainForm.cs @@ -91,7 +91,7 @@ namespace OpenHardwareMonitor.GUI { this.Font = SystemFonts.MessageBoxFont; treeView.Font = SystemFonts.MessageBoxFont; plotPanel.Font = SystemFonts.MessageBoxFont; - treeView.RowHeight = treeView.Font.Height + 1; + treeView.RowHeight = Math.Max(treeView.Font.Height + 1, 17); nodeCheckBox.IsVisibleValueNeeded += nodeCheckBox_IsVisibleValueNeeded; nodeCheckBox.CheckStateChanged += UpdatePlotSelection; diff --git a/Hardware/LPC/Chip.cs b/Hardware/LPC/Chip.cs index 255b466..e6d3a2c 100644 --- a/Hardware/LPC/Chip.cs +++ b/Hardware/LPC/Chip.cs @@ -16,7 +16,7 @@ The Initial Developer of the Original Code is Michael Möller . - Portions created by the Initial Developer are Copyright (C) 2009-2010 + Portions created by the Initial Developer are Copyright (C) 2009-2011 the Initial Developer. All Rights Reserved. Contributor(s): @@ -54,6 +54,7 @@ namespace OpenHardwareMonitor.Hardware.LPC { W83667HGB = 0xB350, W83687THF = 0x8541, NCT6771F = 0xB470, + NCT6776F = 0xC330, F71858 = 0x0507, F71862 = 0x0601, F71869 = 0x0814, @@ -89,6 +90,7 @@ namespace OpenHardwareMonitor.Hardware.LPC { case Chip.W83667HGB: return "Winbond W83667HG-B"; case Chip.W83687THF: return "Winbond W83687THF"; case Chip.NCT6771F: return "Nuvoton NCT6771F"; + case Chip.NCT6776F: return "Nuvoton NCT6776F"; case Chip.Unknown: return "Unkown"; default: return "Unknown"; } diff --git a/Hardware/LPC/LPCIO.cs b/Hardware/LPC/LPCIO.cs index 035087b..ca16d69 100644 --- a/Hardware/LPC/LPCIO.cs +++ b/Hardware/LPC/LPCIO.cs @@ -16,7 +16,7 @@ The Initial Developer of the Original Code is Michael Möller . - Portions created by the Initial Developer are Copyright (C) 2009-2010 + Portions created by the Initial Developer are Copyright (C) 2009-2011 the Initial Developer. All Rights Reserved. Contributor(s): @@ -220,6 +220,13 @@ namespace OpenHardwareMonitor.Hardware.LPC { logicalDeviceNumber = WINBOND_NUVOTON_HARDWARE_MONITOR_LDN; break; } break; + case 0xC3: + switch (revision & 0xF0) { + case 0x30: + chip = Chip.NCT6776F; + logicalDeviceNumber = WINBOND_NUVOTON_HARDWARE_MONITOR_LDN; + break; + } break; } if (chip == Chip.Unknown) { if (id != 0 && id != 0xff) { @@ -279,6 +286,7 @@ namespace OpenHardwareMonitor.Hardware.LPC { superIOs.Add(new W836XX(chip, revision, address)); break; case Chip.NCT6771F: + case Chip.NCT6776F: superIOs.Add(new NCT677X(chip, revision, address)); break; case Chip.F71858: diff --git a/Hardware/LPC/NCT677X.cs b/Hardware/LPC/NCT677X.cs index 50c3113..d204d7d 100644 --- a/Hardware/LPC/NCT677X.cs +++ b/Hardware/LPC/NCT677X.cs @@ -16,7 +16,7 @@ The Initial Developer of the Original Code is Michael Möller . - Portions created by the Initial Developer are Copyright (C) 2010 + Portions created by the Initial Developer are Copyright (C) 2010-2011 the Initial Developer. All Rights Reserved. Contributor(s): @@ -48,7 +48,7 @@ namespace OpenHardwareMonitor.Hardware.LPC { private readonly float?[] voltages = new float?[9]; private readonly float?[] temperatures = new float?[3]; - private readonly float?[] fans = new float?[4]; + private readonly float?[] fans = new float?[0]; // Hardware Monitor private const uint ADDRESS_REGISTER_OFFSET = 0x05; @@ -81,7 +81,10 @@ namespace OpenHardwareMonitor.Hardware.LPC { private readonly int[] TEMPERATURE_HALF_BIT = { 7, 7, -1, 0, 1, 2 }; private readonly ushort[] VOLTAGE_REG = { 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x550, 0x551 }; - private readonly ushort[] FAN_RPM_REG = { 0x656, 0x658, 0x65A, 0x65C}; + private readonly ushort[] FAN_RPM_REG = + { 0x656, 0x658, 0x65A, 0x65C, 0x65E}; + + private readonly int minFanRPM; private enum TemperatureSource : byte { SYSTIN = 1, @@ -112,7 +115,20 @@ namespace OpenHardwareMonitor.Hardware.LPC { this.port = port; if (!IsNuvotonVendor()) - return; + return; + + switch (chip) { + case LPC.Chip.NCT6771F: + fans = new float?[4]; + // min value RPM value with 16-bit fan counter + minFanRPM = (int)(1.35e6 / 0xFFFF); + break; + case LPC.Chip.NCT6776F: + fans = new float?[5]; + // min value RPM value with 13-bit fan counter + minFanRPM = (int)(1.35e6 / 0x1FFF); + break; + } } private bool IsNuvotonVendor() { @@ -170,7 +186,9 @@ namespace OpenHardwareMonitor.Hardware.LPC { for (int i = 0; i < fans.Length; i++) { byte high = ReadByte(FAN_RPM_REG[i]); byte low = ReadByte((ushort)(FAN_RPM_REG[i] + 1)); - fans[i] = (high << 8) | low; + int value = (high << 8) | low; + + fans[i] = value > minFanRPM ? value : 0; } Ring0.ReleaseIsaBusMutex(); diff --git a/Hardware/Mainboard/Model.cs b/Hardware/Mainboard/Model.cs index 6ad9498..0666e1a 100644 --- a/Hardware/Mainboard/Model.cs +++ b/Hardware/Mainboard/Model.cs @@ -16,7 +16,7 @@ The Initial Developer of the Original Code is Michael Möller . - Portions created by the Initial Developer are Copyright (C) 2009-2010 + Portions created by the Initial Developer are Copyright (C) 2009-2011 the Initial Developer. All Rights Reserved. Contributor(s): @@ -49,6 +49,7 @@ namespace OpenHardwareMonitor.Hardware.Mainboard { M4A79XTD_EVO, P5W_DH_Deluxe, P6X58D_E, + P8P67_PRO, Rampage_Extreme, Rampage_II_GENE, diff --git a/Hardware/Mainboard/SMBIOS.cs b/Hardware/Mainboard/SMBIOS.cs index 7c685df..4245792 100644 --- a/Hardware/Mainboard/SMBIOS.cs +++ b/Hardware/Mainboard/SMBIOS.cs @@ -16,7 +16,7 @@ The Initial Developer of the Original Code is Michael Möller . - Portions created by the Initial Developer are Copyright (C) 2009-2010 + Portions created by the Initial Developer are Copyright (C) 2009-2011 the Initial Developer. All Rights Reserved. Contributor(s): @@ -322,6 +322,8 @@ namespace OpenHardwareMonitor.Hardware.Mainboard { return Model.P5W_DH_Deluxe; case "P6X58D-E": return Model.P6X58D_E; + case "P8P67 PRO": + return Model.P8P67_PRO; case "Rampage Extreme": return Model.Rampage_Extreme; case "Rampage II GENE": diff --git a/Hardware/Mainboard/SuperIOHardware.cs b/Hardware/Mainboard/SuperIOHardware.cs index 0a915c4..eda1663 100644 --- a/Hardware/Mainboard/SuperIOHardware.cs +++ b/Hardware/Mainboard/SuperIOHardware.cs @@ -16,7 +16,7 @@ The Initial Developer of the Original Code is Michael Möller . - Portions created by the Initial Developer are Copyright (C) 2009-2010 + Portions created by the Initial Developer are Copyright (C) 2009-2011 the Initial Developer. All Rights Reserved. Contributor(s): @@ -742,22 +742,64 @@ namespace OpenHardwareMonitor.Hardware.Mainboard { f.Add(new Fan("Auxiliary Fan", 2)); break; case Chip.NCT6771F: - v.Add(new Voltage("CPU VCore", 0)); - v.Add(new Voltage("Voltage #2", 1, true)); - v.Add(new Voltage("AVCC", 2, 34, 34)); - v.Add(new Voltage("3VCC", 3, 34, 34)); - v.Add(new Voltage("Voltage #5", 4, true)); - v.Add(new Voltage("Voltage #6", 5, true)); - v.Add(new Voltage("Voltage #7", 6, true)); - v.Add(new Voltage("3VSB", 7, 34, 34)); - v.Add(new Voltage("VBAT", 8, 34, 34)); - t.Add(new Temperature("CPU", 0)); - t.Add(new Temperature("Auxiliary", 1)); - t.Add(new Temperature("System", 2)); - f.Add(new Fan("System Fan", 0)); - f.Add(new Fan("CPU Fan", 1)); - f.Add(new Fan("Auxiliary Fan", 2)); - f.Add(new Fan("Auxiliary Fan #2", 4)); + case Chip.NCT6776F: + switch (manufacturer) { + case Manufacturer.ASUS: + switch (model) { + case Model.P8P67_PRO: // NCT6776F + v.Add(new Voltage("CPU VCore", 0)); + v.Add(new Voltage("Voltage #2", 1, true)); + v.Add(new Voltage("AVCC", 2, 34, 34)); + v.Add(new Voltage("3VCC", 3, 34, 34)); + v.Add(new Voltage("Voltage #5", 4, true)); + v.Add(new Voltage("Voltage #6", 5, true)); + v.Add(new Voltage("Voltage #7", 6, true)); + v.Add(new Voltage("3VSB", 7, 34, 34)); + v.Add(new Voltage("VBAT", 8, 34, 34)); + t.Add(new Temperature("CPU", 0)); + t.Add(new Temperature("Auxiliary", 1)); + t.Add(new Temperature("System", 2)); + f.Add(new Fan("System Fan", 0)); + f.Add(new Fan("CPU Fan", 1)); + f.Add(new Fan("Auxiliary Fan", 2)); + f.Add(new Fan("Auxiliary Fan #2", 3)); + f.Add(new Fan("Auxiliary Fan #3", 4)); + break; + default: + v.Add(new Voltage("CPU VCore", 0)); + v.Add(new Voltage("Voltage #2", 1, true)); + v.Add(new Voltage("AVCC", 2, 34, 34)); + v.Add(new Voltage("3VCC", 3, 34, 34)); + v.Add(new Voltage("Voltage #5", 4, true)); + v.Add(new Voltage("Voltage #6", 5, true)); + v.Add(new Voltage("Voltage #7", 6, true)); + v.Add(new Voltage("3VSB", 7, 34, 34)); + v.Add(new Voltage("VBAT", 8, 34, 34)); + t.Add(new Temperature("CPU", 0)); + t.Add(new Temperature("Auxiliary", 1)); + t.Add(new Temperature("System", 2)); + for (int i = 0; i < superIO.Fans.Length; i++) + f.Add(new Fan("Fan #" + (i + 1), i)); + break; + } + break; + default: + v.Add(new Voltage("CPU VCore", 0)); + v.Add(new Voltage("Voltage #2", 1, true)); + v.Add(new Voltage("AVCC", 2, 34, 34)); + v.Add(new Voltage("3VCC", 3, 34, 34)); + v.Add(new Voltage("Voltage #5", 4, true)); + v.Add(new Voltage("Voltage #6", 5, true)); + v.Add(new Voltage("Voltage #7", 6, true)); + v.Add(new Voltage("3VSB", 7, 34, 34)); + v.Add(new Voltage("VBAT", 8, 34, 34)); + t.Add(new Temperature("CPU", 0)); + t.Add(new Temperature("Auxiliary", 1)); + t.Add(new Temperature("System", 2)); + for (int i = 0; i < superIO.Fans.Length; i++) + f.Add(new Fan("Fan #" + (i + 1), i)); + break; + } break; default: for (int i = 0; i < superIO.Voltages.Length; i++)