1.1 --- a/Hardware/LPC/NCT677X.cs Sat Mar 19 16:13:49 2011 +0000
1.2 +++ b/Hardware/LPC/NCT677X.cs Sat Mar 19 22:55:05 2011 +0000
1.3 @@ -16,7 +16,7 @@
1.4
1.5 The Initial Developer of the Original Code is
1.6 Michael Möller <m.moeller@gmx.ch>.
1.7 - Portions created by the Initial Developer are Copyright (C) 2010
1.8 + Portions created by the Initial Developer are Copyright (C) 2010-2011
1.9 the Initial Developer. All Rights Reserved.
1.10
1.11 Contributor(s):
1.12 @@ -48,7 +48,7 @@
1.13
1.14 private readonly float?[] voltages = new float?[9];
1.15 private readonly float?[] temperatures = new float?[3];
1.16 - private readonly float?[] fans = new float?[4];
1.17 + private readonly float?[] fans = new float?[0];
1.18
1.19 // Hardware Monitor
1.20 private const uint ADDRESS_REGISTER_OFFSET = 0x05;
1.21 @@ -81,7 +81,10 @@
1.22 private readonly int[] TEMPERATURE_HALF_BIT = { 7, 7, -1, 0, 1, 2 };
1.23 private readonly ushort[] VOLTAGE_REG =
1.24 { 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x550, 0x551 };
1.25 - private readonly ushort[] FAN_RPM_REG = { 0x656, 0x658, 0x65A, 0x65C};
1.26 + private readonly ushort[] FAN_RPM_REG =
1.27 + { 0x656, 0x658, 0x65A, 0x65C, 0x65E};
1.28 +
1.29 + private readonly int minFanRPM;
1.30
1.31 private enum TemperatureSource : byte {
1.32 SYSTIN = 1,
1.33 @@ -112,7 +115,20 @@
1.34 this.port = port;
1.35
1.36 if (!IsNuvotonVendor())
1.37 - return;
1.38 + return;
1.39 +
1.40 + switch (chip) {
1.41 + case LPC.Chip.NCT6771F:
1.42 + fans = new float?[4];
1.43 + // min value RPM value with 16-bit fan counter
1.44 + minFanRPM = (int)(1.35e6 / 0xFFFF);
1.45 + break;
1.46 + case LPC.Chip.NCT6776F:
1.47 + fans = new float?[5];
1.48 + // min value RPM value with 13-bit fan counter
1.49 + minFanRPM = (int)(1.35e6 / 0x1FFF);
1.50 + break;
1.51 + }
1.52 }
1.53
1.54 private bool IsNuvotonVendor() {
1.55 @@ -170,7 +186,9 @@
1.56 for (int i = 0; i < fans.Length; i++) {
1.57 byte high = ReadByte(FAN_RPM_REG[i]);
1.58 byte low = ReadByte((ushort)(FAN_RPM_REG[i] + 1));
1.59 - fans[i] = (high << 8) | low;
1.60 + int value = (high << 8) | low;
1.61 +
1.62 + fans[i] = value > minFanRPM ? value : 0;
1.63 }
1.64
1.65 Ring0.ReleaseIsaBusMutex();