Hardware/LPC/IT87XX.cs
changeset 195 0ee888c485d5
parent 182 4801e9eaf979
child 228 458a6c3de579
     1.1 --- a/Hardware/LPC/IT87XX.cs	Tue Sep 21 10:33:28 2010 +0000
     1.2 +++ b/Hardware/LPC/IT87XX.cs	Tue Sep 21 20:32:36 2010 +0000
     1.3 @@ -41,16 +41,16 @@
     1.4  namespace OpenHardwareMonitor.Hardware.LPC {
     1.5    internal class IT87XX : ISuperIO {
     1.6         
     1.7 -    private ushort address;
     1.8 -    private Chip chip;
     1.9 -    private byte version;
    1.10 +    private readonly ushort address;
    1.11 +    private readonly Chip chip;
    1.12 +    private readonly byte version;
    1.13  
    1.14      private readonly ushort addressReg;
    1.15      private readonly ushort dataReg;
    1.16  
    1.17 -    private float?[] voltages = new float?[0];
    1.18 -    private float?[] temperatures = new float?[0];
    1.19 -    private float?[] fans = new float?[0];
    1.20 +    private readonly float?[] voltages = new float?[0];
    1.21 +    private readonly float?[] temperatures = new float?[0];
    1.22 +    private readonly float?[] fans = new float?[0];
    1.23  
    1.24      private readonly float voltageGain;
    1.25     
    1.26 @@ -66,9 +66,9 @@
    1.27      private const byte TEMPERATURE_BASE_REG = 0x29;
    1.28      private const byte VENDOR_ID_REGISTER = 0x58;
    1.29      private const byte FAN_TACHOMETER_16_BIT_ENABLE_REGISTER = 0x0c;
    1.30 -    private byte[] FAN_TACHOMETER_REG = 
    1.31 +    private readonly byte[] FAN_TACHOMETER_REG = 
    1.32        new byte[] { 0x0d, 0x0e, 0x0f, 0x80, 0x82 };
    1.33 -    private byte[] FAN_TACHOMETER_EXT_REG =
    1.34 +    private readonly byte[] FAN_TACHOMETER_EXT_REG =
    1.35        new byte[] { 0x18, 0x19, 0x1a, 0x81, 0x83 };
    1.36      private const byte VOLTAGE_BASE_REG = 0x20;
    1.37  
    1.38 @@ -143,10 +143,8 @@
    1.39            r.Append(" ");
    1.40            bool valid;
    1.41            byte value = ReadByte((byte)((i << 4) | j), out valid);
    1.42 -          if (valid)
    1.43 -            r.Append(value.ToString("X2", CultureInfo.InvariantCulture));
    1.44 -          else
    1.45 -            r.Append("??");
    1.46 +          r.Append(
    1.47 +            valid ? value.ToString("X2", CultureInfo.InvariantCulture) : "??");
    1.48          }
    1.49          r.AppendLine();
    1.50        }