Hardware/LPC/W836XX.cs
changeset 195 0ee888c485d5
parent 182 4801e9eaf979
child 228 458a6c3de579
     1.1 --- a/Hardware/LPC/W836XX.cs	Tue Sep 21 10:33:28 2010 +0000
     1.2 +++ b/Hardware/LPC/W836XX.cs	Tue Sep 21 20:32:36 2010 +0000
     1.3 @@ -42,19 +42,19 @@
     1.4  namespace OpenHardwareMonitor.Hardware.LPC {
     1.5    internal class W836XX : ISuperIO {
     1.6  
     1.7 -    private ushort address;
     1.8 -    private byte revision;
     1.9 +    private readonly ushort address;
    1.10 +    private readonly byte revision;
    1.11  
    1.12 -    private Chip chip;
    1.13 +    private readonly Chip chip;
    1.14  
    1.15 -    private float?[] voltages = new float?[0];
    1.16 -    private float?[] temperatures = new float?[0];    
    1.17 -    private float?[] fans = new float?[0];
    1.18 +    private readonly float?[] voltages = new float?[0];
    1.19 +    private readonly float?[] temperatures = new float?[0];    
    1.20 +    private readonly float?[] fans = new float?[0];
    1.21  
    1.22 -    private bool[] peciTemperature = new bool[0];
    1.23 -    private byte[] voltageRegister = new byte[0];
    1.24 -    private byte[] voltageBank = new byte[0];
    1.25 -    private float voltageGain = 0.008f;
    1.26 +    private readonly bool[] peciTemperature = new bool[0];
    1.27 +    private readonly byte[] voltageRegister = new byte[0];
    1.28 +    private readonly byte[] voltageBank = new byte[0];
    1.29 +    private readonly float voltageGain = 0.008f;
    1.30  
    1.31      // Consts 
    1.32      private const ushort WINBOND_VENDOR_ID = 0x5CA3;
    1.33 @@ -70,15 +70,18 @@
    1.34      private const byte VENDOR_ID_REGISTER = 0x4F;
    1.35      private const byte TEMPERATURE_SOURCE_SELECT_REG = 0x49;
    1.36  
    1.37 -    private byte[] TEMPERATURE_REG = new byte[] { 0x50, 0x50, 0x27 };
    1.38 -    private byte[] TEMPERATURE_BANK = new byte[] { 1, 2, 0 };
    1.39 +    private readonly byte[] TEMPERATURE_REG = new byte[] { 0x50, 0x50, 0x27 };
    1.40 +    private readonly byte[] TEMPERATURE_BANK = new byte[] { 1, 2, 0 };
    1.41  
    1.42 -    private byte[] FAN_TACHO_REG = new byte[] { 0x28, 0x29, 0x2A, 0x3F, 0x53 };
    1.43 -    private byte[] FAN_TACHO_BANK = new byte[] { 0, 0, 0, 0, 5 };       
    1.44 -    private byte[] FAN_BIT_REG = new byte[] { 0x47, 0x4B, 0x4C, 0x59, 0x5D };
    1.45 -    private byte[] FAN_DIV_BIT0 = new byte[] { 36, 38, 30, 8, 10 };
    1.46 -    private byte[] FAN_DIV_BIT1 = new byte[] { 37, 39, 31, 9, 11 };
    1.47 -    private byte[] FAN_DIV_BIT2 = new byte[] { 5, 6, 7, 23, 15 };
    1.48 +    private readonly byte[] FAN_TACHO_REG = 
    1.49 +      new byte[] { 0x28, 0x29, 0x2A, 0x3F, 0x53 };
    1.50 +    private readonly byte[] FAN_TACHO_BANK = 
    1.51 +      new byte[] { 0, 0, 0, 0, 5 };       
    1.52 +    private readonly byte[] FAN_BIT_REG =
    1.53 +      new byte[] { 0x47, 0x4B, 0x4C, 0x59, 0x5D };
    1.54 +    private readonly byte[] FAN_DIV_BIT0 = new byte[] { 36, 38, 30, 8, 10 };
    1.55 +    private readonly byte[] FAN_DIV_BIT1 = new byte[] { 37, 39, 31, 9, 11 };
    1.56 +    private readonly byte[] FAN_DIV_BIT2 = new byte[] { 5, 6, 7, 23, 15 };
    1.57  
    1.58      private byte ReadByte(byte bank, byte register) {
    1.59        WinRing0.WriteIoPortByte(