Subversion Repositories group.electronics

Rev

Rev 172 | Rev 177 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 172 Rev 173
Line 16... Line 16...
16
            Globals.bios = new DcsBios();
16
            Globals.bios = new DcsBios();
17
            bios.InitUDP();
17
            bios.InitUDP();
18
        }
18
        }
19
 
19
 
20
        //public static Dictionary<UInt16, Led> outputs = new Dictionary<UInt16, Led>();
20
        //public static Dictionary<UInt16, Led> outputs = new Dictionary<UInt16, Led>();
21
        public static Dictionary<UInt16, UInt16> BiosOutput = new Dictionary<UInt16, UInt16>();
21
        public static volatile Dictionary<UInt16, UInt16> BiosOutput = new Dictionary<UInt16, UInt16>();
22
 
22
 
23
        public static InputSimulator SendKey = new InputSimulator();
23
        public static InputSimulator SendKey = new InputSimulator();
24
 
24
 
25
        public static UInt16 map_uint16(UInt16 x, UInt16 in_min, UInt16 in_max, UInt16 out_min, UInt16 out_max) {
25
        public static UInt16 map_uint16(UInt16 x, UInt16 in_min, UInt16 in_max, UInt16 out_min, UInt16 out_max) {
26
            return (UInt16)((x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min);
26
            return (UInt16)((x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min);
Line 28... Line 28...
28
 
28
 
29
        public static bool readBit(byte data, int bitNum) {
29
        public static bool readBit(byte data, int bitNum) {
30
            return (data & (1 << bitNum)) != 0;
30
            return (data & (1 << bitNum)) != 0;
31
        }
31
        }
32
 
32
 
33
        public static byte setBit(byte data, int bitNum) {
33
        public static void setBit(ref byte data, int bitNum) {
34
            return (byte)(data | (1 << bitNum));
34
            data |= (byte)(1 << bitNum);
35
        }
35
        }
36
 
36
 
37
        public static byte clearBit(byte data, int bitNum) {
37
        public static void clearBit(ref byte data, int bitNum) {
38
            return (byte)(data & ~(1 << bitNum));
38
            data &= (byte)~(1 << bitNum);
39
        }
39
        }
40
    }
40
    }
41
}
41
}