Added upper bound for valid fan RPM on IT87.
authormoel.mich
Tue, 09 Feb 2010 18:52:52 +0000
changeset 3632adc68f54f8
parent 35 2daf59392c88
child 37 124f735b73aa
Added upper bound for valid fan RPM on IT87.
Hardware/CPU/CPUGroup.cs
Hardware/LPC/IT87XX.cs
     1.1 --- a/Hardware/CPU/CPUGroup.cs	Mon Feb 08 20:23:24 2010 +0000
     1.2 +++ b/Hardware/CPU/CPUGroup.cs	Tue Feb 09 18:52:52 2010 +0000
     1.3 @@ -111,7 +111,8 @@
     1.4              AppendRegister(nameBuilder, edx);
     1.5            }
     1.6          }
     1.7 -        cpuBrandString = nameBuilder.ToString().Trim('\0').Trim();
     1.8 +        nameBuilder.Replace('\0', ' ');
     1.9 +        cpuBrandString = nameBuilder.ToString().Trim();
    1.10          nameBuilder.Replace("(R)", " ");
    1.11          nameBuilder.Replace("(TM)", " ");
    1.12          nameBuilder.Replace("(tm)", " ");
     2.1 --- a/Hardware/LPC/IT87XX.cs	Mon Feb 08 20:23:24 2010 +0000
     2.2 +++ b/Hardware/LPC/IT87XX.cs	Tue Feb 09 18:52:52 2010 +0000
     2.3 @@ -69,10 +69,24 @@
     2.4        new byte[] { 0x18, 0x19, 0x1a, 0x81, 0x83 };
     2.5      private const byte VOLTAGE_BASE_REG = 0x20;  
     2.6      
     2.7 -    private byte ReadByte(byte register) {
     2.8 +    /* private byte ReadByte(byte register) {
     2.9        WinRing0.WriteIoPortByte(
    2.10          (ushort)(address + ADDRESS_REGISTER_OFFSET), register);
    2.11        return WinRing0.ReadIoPortByte((ushort)(address + DATA_REGISTER_OFFSET));
    2.12 +    } */
    2.13 +    private byte ReadByte(byte register) {
    2.14 +      return new Utilities.HexStringArray(
    2.15 +        @"19 00 00 00 00 00 00 00 00 80 3F C9 07 9B A3 FF
    2.16 +          FF FF FF 73 D7 80 81 40 00 03 FF FF FF FF FF FF
    2.17 +          50 70 D2 B9 BA 57 48 FF BD 24 24 2D 84 DC DC DC
    2.18 +          FF FF FF FF FF FF FF FF FF FF EF FF FF FF FF FF
    2.19 +          3C 7F 70 7F 70 7F 5F 74 2D 40 9C 22 FF FF FF FF
    2.20 +          FF 15 7F 7F 7F 50 FF 56 90 0A 03 12 64 00 00 83
    2.21 +          00 00 50 7F 10 24 FF FF 00 23 50 40 10 24 FF FF
    2.22 +          7F 7F 7F 00 00 24 FF FF FF FF FF FF FF FF FF FF
    2.23 +          19 00 00 00 00 00 00 00 00 80 3F C9 07 9B A3 FF
    2.24 +          FF FF FF 73 D7 80 81 40 00 03 FF FF FF FF FF FF
    2.25 +          50 70 D2 B9 BA 57 48 FF BD 24 24 2D 84 DC DC DC")[register];
    2.26      }
    2.27  
    2.28      public IT87XX(Chip chip, ushort address) : base (chip) {
    2.29 @@ -162,7 +176,7 @@
    2.30          int value = ReadByte(FAN_TACHOMETER_REG[sensor.Index]);
    2.31          value |= ReadByte(FAN_TACHOMETER_EXT_REG[sensor.Index]) << 8;
    2.32  
    2.33 -        if (value > 0) {
    2.34 +        if (value > 0x3f) {
    2.35            sensor.Value = (value < 0xffff) ? 1.35e6f / ((value) * 2) : 0;
    2.36            if (sensor.Value > 0)
    2.37              ActivateSensor(sensor);