Added upper bound for valid fan RPM on IT87.

This commit is contained in:
Michael Möller
2010-02-09 18:52:52 +00:00
parent 2e34c0a7b0
commit 2bf6230d56
2 changed files with 18 additions and 3 deletions

View File

@@ -111,7 +111,8 @@ namespace OpenHardwareMonitor.Hardware.CPU {
AppendRegister(nameBuilder, edx);
}
}
cpuBrandString = nameBuilder.ToString().Trim('\0').Trim();
nameBuilder.Replace('\0', ' ');
cpuBrandString = nameBuilder.ToString().Trim();
nameBuilder.Replace("(R)", " ");
nameBuilder.Replace("(TM)", " ");
nameBuilder.Replace("(tm)", " ");

View File

@@ -69,10 +69,24 @@ namespace OpenHardwareMonitor.Hardware.LPC {
new byte[] { 0x18, 0x19, 0x1a, 0x81, 0x83 };
private const byte VOLTAGE_BASE_REG = 0x20;
private byte ReadByte(byte register) {
/* private byte ReadByte(byte register) {
WinRing0.WriteIoPortByte(
(ushort)(address + ADDRESS_REGISTER_OFFSET), register);
return WinRing0.ReadIoPortByte((ushort)(address + DATA_REGISTER_OFFSET));
} */
private byte ReadByte(byte register) {
return new Utilities.HexStringArray(
@"19 00 00 00 00 00 00 00 00 80 3F C9 07 9B A3 FF
FF FF FF 73 D7 80 81 40 00 03 FF FF FF FF FF FF
50 70 D2 B9 BA 57 48 FF BD 24 24 2D 84 DC DC DC
FF FF FF FF FF FF FF FF FF FF EF FF FF FF FF FF
3C 7F 70 7F 70 7F 5F 74 2D 40 9C 22 FF FF FF FF
FF 15 7F 7F 7F 50 FF 56 90 0A 03 12 64 00 00 83
00 00 50 7F 10 24 FF FF 00 23 50 40 10 24 FF FF
7F 7F 7F 00 00 24 FF FF FF FF FF FF FF FF FF FF
19 00 00 00 00 00 00 00 00 80 3F C9 07 9B A3 FF
FF FF FF 73 D7 80 81 40 00 03 FF FF FF FF FF FF
50 70 D2 B9 BA 57 48 FF BD 24 24 2D 84 DC DC DC")[register];
}
public IT87XX(Chip chip, ushort address) : base (chip) {
@@ -162,7 +176,7 @@ namespace OpenHardwareMonitor.Hardware.LPC {
int value = ReadByte(FAN_TACHOMETER_REG[sensor.Index]);
value |= ReadByte(FAN_TACHOMETER_EXT_REG[sensor.Index]) << 8;
if (value > 0) {
if (value > 0x3f) {
sensor.Value = (value < 0xffff) ? 1.35e6f / ((value) * 2) : 0;
if (sensor.Value > 0)
ActivateSensor(sensor);