mirror of
https://github.com/openhardwaremonitor/openhardwaremonitor
synced 2025-08-28 12:57:44 +00:00
Changed the NCT679XD fan RPM calculation to use the 13-bit fan count register instead of the 16-bit RPM register.
This commit is contained in:
parent
a3fe5e66bd
commit
39cfbc709d
@ -66,6 +66,10 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
|||||||
private readonly ushort[] fanRpmBaseRegister;
|
private readonly ushort[] fanRpmBaseRegister;
|
||||||
private readonly int minFanRPM;
|
private readonly int minFanRPM;
|
||||||
|
|
||||||
|
private readonly ushort[] fanCountRegister;
|
||||||
|
private readonly int maxFanCount;
|
||||||
|
private readonly int minFanCount;
|
||||||
|
|
||||||
private bool[] restoreDefaultFanControlRequired = new bool[7];
|
private bool[] restoreDefaultFanControlRequired = new bool[7];
|
||||||
private byte[] initialFanControlMode = new byte[7];
|
private byte[] initialFanControlMode = new byte[7];
|
||||||
private byte[] initialFanPwmCommand = new byte[7];
|
private byte[] initialFanPwmCommand = new byte[7];
|
||||||
@ -303,11 +307,14 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
fanRpmBaseRegister = new ushort[]
|
fanCountRegister = new ushort[]
|
||||||
{ 0x4C0, 0x4C2, 0x4C4, 0x4C6, 0x4C8, 0x4CA, 0x4CE };
|
{ 0x4B0, 0x4B2, 0x4B4, 0x4B6, 0x4B8, 0x4BA, 0x4CC };
|
||||||
|
|
||||||
// min RPM value with 13-bit fan counter
|
// max value for 13-bit fan counter
|
||||||
minFanRPM = (int)(1.35e6 / 0x1FFF);
|
maxFanCount = 0x1FFF;
|
||||||
|
|
||||||
|
// min value that could be transfered to 16-bit RPM registers
|
||||||
|
minFanCount = 0x15;
|
||||||
|
|
||||||
voltages = new float?[15];
|
voltages = new float?[15];
|
||||||
voltageRegisters = new ushort[]
|
voltageRegisters = new ushort[]
|
||||||
@ -514,11 +521,26 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < fans.Length; i++) {
|
for (int i = 0; i < fans.Length; i++) {
|
||||||
byte high = ReadByte(fanRpmBaseRegister[i]);
|
if (fanCountRegister != null) {
|
||||||
byte low = ReadByte((ushort)(fanRpmBaseRegister[i] + 1));
|
byte high = ReadByte(fanCountRegister[i]);
|
||||||
int value = (high << 8) | low;
|
byte low = ReadByte((ushort)(fanCountRegister[i] + 1));
|
||||||
|
int count = (high << 5) | (low & 0x1F);
|
||||||
|
if (count < maxFanCount) {
|
||||||
|
if (count >= minFanCount) {
|
||||||
|
fans[i] = 1.35e6f / count;
|
||||||
|
} else {
|
||||||
|
fans[i] = null;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
fans[i] = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
byte high = ReadByte(fanRpmBaseRegister[i]);
|
||||||
|
byte low = ReadByte((ushort)(fanRpmBaseRegister[i] + 1));
|
||||||
|
int value = (high << 8) | low;
|
||||||
|
|
||||||
fans[i] = value > minFanRPM ? value : 0;
|
fans[i] = value > minFanRPM ? value : 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < controls.Length; i++) {
|
for (int i = 0; i < controls.Length; i++) {
|
||||||
|
@ -10,5 +10,5 @@
|
|||||||
|
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
[assembly: AssemblyVersion("0.9.3.1")]
|
[assembly: AssemblyVersion("0.9.3.2")]
|
||||||
[assembly: AssemblyInformationalVersion("0.9.3.1 Alpha")]
|
[assembly: AssemblyInformationalVersion("0.9.3.2 Alpha")]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user