
Iztech Fork
Fork of A2_Interface3_V_0_0 by
BoardComms.h@2:18608d894fc4, 2017-08-17 (annotated)
- Committer:
- Iztech
- Date:
- Thu Aug 17 13:36:28 2017 +0000
- Revision:
- 2:18608d894fc4
- Parent:
- 0:ea876cfd7385
AndyR v3
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
rogermcardell | 0:ea876cfd7385 | 1 | /* |
rogermcardell | 0:ea876cfd7385 | 2 | Programmer: Roger McArdell |
rogermcardell | 0:ea876cfd7385 | 3 | Date: 02/08/2017 |
rogermcardell | 0:ea876cfd7385 | 4 | Version |
rogermcardell | 0:ea876cfd7385 | 5 | V0.1 First version |
rogermcardell | 0:ea876cfd7385 | 6 | */ |
rogermcardell | 0:ea876cfd7385 | 7 | const string Revision = "0.0.1"; |
rogermcardell | 0:ea876cfd7385 | 8 | |
rogermcardell | 0:ea876cfd7385 | 9 | static uint8_t EthAddWrite = '\xBE'; |
rogermcardell | 0:ea876cfd7385 | 10 | static uint8_t EthAddRead = '\xBF'; |
rogermcardell | 0:ea876cfd7385 | 11 | |
rogermcardell | 0:ea876cfd7385 | 12 | // Prototypes |
rogermcardell | 0:ea876cfd7385 | 13 | void CheckForData(); |
rogermcardell | 0:ea876cfd7385 | 14 | void CheckaboxData(); |
rogermcardell | 0:ea876cfd7385 | 15 | void WriteCEC(char Port, char data); |
rogermcardell | 0:ea876cfd7385 | 16 | void ReadCEC(); |
rogermcardell | 0:ea876cfd7385 | 17 | void Processabox(string InString); |
rogermcardell | 0:ea876cfd7385 | 18 | void SetLEDs(uint8_t LEDNo, uint8_t LEDState); |
rogermcardell | 0:ea876cfd7385 | 19 | |
rogermcardell | 0:ea876cfd7385 | 20 | string RegBuff; |
rogermcardell | 0:ea876cfd7385 | 21 | string InString1 = ""; |
rogermcardell | 0:ea876cfd7385 | 22 | |
rogermcardell | 0:ea876cfd7385 | 23 | void CheckForData() |
rogermcardell | 0:ea876cfd7385 | 24 | { |
rogermcardell | 0:ea876cfd7385 | 25 | string bufchar; |
rogermcardell | 0:ea876cfd7385 | 26 | |
rogermcardell | 0:ea876cfd7385 | 27 | char c; |
rogermcardell | 0:ea876cfd7385 | 28 | while(pc.readable()) |
rogermcardell | 0:ea876cfd7385 | 29 | { |
rogermcardell | 0:ea876cfd7385 | 30 | c = pc.getc(); |
rogermcardell | 0:ea876cfd7385 | 31 | RegBuff += c; |
rogermcardell | 0:ea876cfd7385 | 32 | bufchar = c; |
rogermcardell | 0:ea876cfd7385 | 33 | pc.printf("%s", bufchar.c_str()); // echo back to screen |
rogermcardell | 0:ea876cfd7385 | 34 | |
rogermcardell | 0:ea876cfd7385 | 35 | if (c == '\x0D') |
rogermcardell | 0:ea876cfd7385 | 36 | { |
rogermcardell | 0:ea876cfd7385 | 37 | switch(RegBuff[0]) |
rogermcardell | 0:ea876cfd7385 | 38 | { |
rogermcardell | 0:ea876cfd7385 | 39 | case 'M': // Matrix |
rogermcardell | 0:ea876cfd7385 | 40 | if (RegBuff[1] == 'R') //Read |
rogermcardell | 0:ea876cfd7385 | 41 | { |
rogermcardell | 0:ea876cfd7385 | 42 | pc.printf("Byte Received Read: %s\r\n", RegBuff.c_str()); |
rogermcardell | 0:ea876cfd7385 | 43 | switch(RegBuff[2]) |
rogermcardell | 0:ea876cfd7385 | 44 | { |
rogermcardell | 0:ea876cfd7385 | 45 | case '0': |
rogermcardell | 0:ea876cfd7385 | 46 | switch(RegBuff[3]) |
rogermcardell | 0:ea876cfd7385 | 47 | { |
rogermcardell | 0:ea876cfd7385 | 48 | case '0': ReadMatrix('\x00',1); break; |
rogermcardell | 0:ea876cfd7385 | 49 | case '1': ReadMatrix('\x01',1); break; |
rogermcardell | 0:ea876cfd7385 | 50 | case '2': ReadMatrix('\x02',1); break; |
rogermcardell | 0:ea876cfd7385 | 51 | case '3': ReadMatrix('\x03',4); break; |
rogermcardell | 0:ea876cfd7385 | 52 | case '4': ReadMatrix('\x04',8); break; |
rogermcardell | 0:ea876cfd7385 | 53 | case '5': ReadMatrix('\x05',2); break; |
rogermcardell | 0:ea876cfd7385 | 54 | case '6': ReadMatrix('\x06',2); break; |
rogermcardell | 0:ea876cfd7385 | 55 | case '7': ReadMatrix('\x07',1); break; |
rogermcardell | 0:ea876cfd7385 | 56 | case '8': ReadMatrix('\x08',1); break; |
rogermcardell | 0:ea876cfd7385 | 57 | case '9': ReadMatrix('\x09',1); break; |
rogermcardell | 0:ea876cfd7385 | 58 | case 'A': ReadMatrix('\x0A',1); break; |
rogermcardell | 0:ea876cfd7385 | 59 | case 'B': ReadMatrix('\x0B',2); break; |
rogermcardell | 0:ea876cfd7385 | 60 | case 'C': ReadMatrix('\x0C',1); break; |
rogermcardell | 0:ea876cfd7385 | 61 | case 'E': ReadMatrix('\x0E',6); break; |
rogermcardell | 0:ea876cfd7385 | 62 | case 'F': ReadMatrix('\x0F',6); break; |
rogermcardell | 0:ea876cfd7385 | 63 | } |
rogermcardell | 0:ea876cfd7385 | 64 | break; |
rogermcardell | 0:ea876cfd7385 | 65 | case '1': |
rogermcardell | 0:ea876cfd7385 | 66 | switch(RegBuff[3]) |
rogermcardell | 0:ea876cfd7385 | 67 | { |
rogermcardell | 0:ea876cfd7385 | 68 | case '0': ReadMatrix('\x10',5); break; |
rogermcardell | 0:ea876cfd7385 | 69 | case '1': ReadMatrix('\x11',5); break; |
rogermcardell | 0:ea876cfd7385 | 70 | case '2': ReadMatrix('\x12',5); break; |
rogermcardell | 0:ea876cfd7385 | 71 | case '3': ReadMatrix('\x13',5); break; |
rogermcardell | 0:ea876cfd7385 | 72 | case '4': ReadMatrix('\x14',5); break; |
rogermcardell | 0:ea876cfd7385 | 73 | case '5': ReadMatrix('\x15',5); break; |
rogermcardell | 0:ea876cfd7385 | 74 | case '6': ReadMatrix('\x16',5); break; |
rogermcardell | 0:ea876cfd7385 | 75 | case '7': ReadMatrix('\x17',5); break; |
rogermcardell | 0:ea876cfd7385 | 76 | case '8': ReadMatrix('\x18',5); break; |
rogermcardell | 0:ea876cfd7385 | 77 | } |
rogermcardell | 0:ea876cfd7385 | 78 | break; |
rogermcardell | 0:ea876cfd7385 | 79 | case '2': |
rogermcardell | 0:ea876cfd7385 | 80 | switch(RegBuff[3]) |
rogermcardell | 0:ea876cfd7385 | 81 | { |
rogermcardell | 0:ea876cfd7385 | 82 | case '0': ReadMatrix('\x20',5); break; |
rogermcardell | 0:ea876cfd7385 | 83 | case '1': ReadMatrix('\x21',5); break; |
rogermcardell | 0:ea876cfd7385 | 84 | } |
rogermcardell | 0:ea876cfd7385 | 85 | break; |
rogermcardell | 0:ea876cfd7385 | 86 | } |
rogermcardell | 0:ea876cfd7385 | 87 | } |
rogermcardell | 0:ea876cfd7385 | 88 | else if (RegBuff[1] == 'W') //Write |
rogermcardell | 0:ea876cfd7385 | 89 | { |
rogermcardell | 0:ea876cfd7385 | 90 | pc.printf("Byte Received Write: %s\r\n", RegBuff.c_str()); |
rogermcardell | 0:ea876cfd7385 | 91 | WriteMatrix(RegBuff); |
rogermcardell | 0:ea876cfd7385 | 92 | } |
rogermcardell | 0:ea876cfd7385 | 93 | else if (RegBuff[1] == 'S') // Set matrix switcher |
rogermcardell | 0:ea876cfd7385 | 94 | { |
rogermcardell | 0:ea876cfd7385 | 95 | SwitchMatrix(RegBuff[2], RegBuff[3]); |
rogermcardell | 0:ea876cfd7385 | 96 | } |
rogermcardell | 0:ea876cfd7385 | 97 | break; |
rogermcardell | 0:ea876cfd7385 | 98 | case 'S': |
rogermcardell | 0:ea876cfd7385 | 99 | if (RegBuff[1] == 'R') //Read |
rogermcardell | 0:ea876cfd7385 | 100 | { |
rogermcardell | 0:ea876cfd7385 | 101 | } |
rogermcardell | 0:ea876cfd7385 | 102 | else |
rogermcardell | 0:ea876cfd7385 | 103 | if (RegBuff[1] == 'W') //Write |
rogermcardell | 0:ea876cfd7385 | 104 | { |
rogermcardell | 0:ea876cfd7385 | 105 | switch(RegBuff[2]) |
rogermcardell | 0:ea876cfd7385 | 106 | { |
rogermcardell | 0:ea876cfd7385 | 107 | case '1': |
rogermcardell | 0:ea876cfd7385 | 108 | switch(RegBuff[3]) |
rogermcardell | 0:ea876cfd7385 | 109 | { |
rogermcardell | 0:ea876cfd7385 | 110 | case '0': WriteCEC(Button1Address, Off); break; |
rogermcardell | 0:ea876cfd7385 | 111 | case '1': WriteCEC(Button1Address, Green); break; |
rogermcardell | 0:ea876cfd7385 | 112 | case '2': WriteCEC(Button1Address, Blue); break; |
rogermcardell | 0:ea876cfd7385 | 113 | case '3': WriteCEC(Button1Address, Red); break; |
rogermcardell | 0:ea876cfd7385 | 114 | case '4': WriteCEC(Button1Address, FlashRed); break; |
rogermcardell | 0:ea876cfd7385 | 115 | case '5': WriteCEC(Button1Address, FlashRedGreen); break; |
rogermcardell | 0:ea876cfd7385 | 116 | case '6': WriteCEC(Button1Address, FlashBlue); break; |
rogermcardell | 0:ea876cfd7385 | 117 | } |
rogermcardell | 0:ea876cfd7385 | 118 | break; |
rogermcardell | 0:ea876cfd7385 | 119 | case '2': |
rogermcardell | 0:ea876cfd7385 | 120 | switch(RegBuff[3]) |
rogermcardell | 0:ea876cfd7385 | 121 | { |
rogermcardell | 0:ea876cfd7385 | 122 | case '0': WriteCEC(Button2Address, Off); break; |
rogermcardell | 0:ea876cfd7385 | 123 | case '1': WriteCEC(Button2Address, Green); break; |
rogermcardell | 0:ea876cfd7385 | 124 | case '2': WriteCEC(Button2Address, Blue); break; |
rogermcardell | 0:ea876cfd7385 | 125 | case '3': WriteCEC(Button2Address, Red); break; |
rogermcardell | 0:ea876cfd7385 | 126 | case '4': WriteCEC(Button2Address, FlashRed); break; |
rogermcardell | 0:ea876cfd7385 | 127 | case '5': WriteCEC(Button2Address, FlashRedGreen); break; |
rogermcardell | 0:ea876cfd7385 | 128 | case '6': WriteCEC(Button2Address, FlashBlue); break; |
rogermcardell | 0:ea876cfd7385 | 129 | } |
rogermcardell | 0:ea876cfd7385 | 130 | break; |
rogermcardell | 0:ea876cfd7385 | 131 | case '3': |
rogermcardell | 0:ea876cfd7385 | 132 | switch(RegBuff[3]) |
rogermcardell | 0:ea876cfd7385 | 133 | { |
rogermcardell | 0:ea876cfd7385 | 134 | case '0': WriteCEC(Button3Address, Off); break; |
rogermcardell | 0:ea876cfd7385 | 135 | case '1': WriteCEC(Button3Address, Green); break; |
rogermcardell | 0:ea876cfd7385 | 136 | case '2': WriteCEC(Button3Address, Blue); break; |
rogermcardell | 0:ea876cfd7385 | 137 | case '3': WriteCEC(Button3Address, Red); break; |
rogermcardell | 0:ea876cfd7385 | 138 | case '4': WriteCEC(Button3Address, FlashRed); break; |
rogermcardell | 0:ea876cfd7385 | 139 | case '5': WriteCEC(Button3Address, FlashRedGreen); break; |
rogermcardell | 0:ea876cfd7385 | 140 | case '6': WriteCEC(Button3Address, FlashBlue); break; |
rogermcardell | 0:ea876cfd7385 | 141 | } |
rogermcardell | 0:ea876cfd7385 | 142 | break; |
rogermcardell | 0:ea876cfd7385 | 143 | case '4': |
rogermcardell | 0:ea876cfd7385 | 144 | switch(RegBuff[3]) |
rogermcardell | 0:ea876cfd7385 | 145 | { |
rogermcardell | 0:ea876cfd7385 | 146 | case '0': WriteCEC(Button4Address, Off); break; |
rogermcardell | 0:ea876cfd7385 | 147 | case '1': WriteCEC(Button4Address, Green); break; |
rogermcardell | 0:ea876cfd7385 | 148 | case '2': WriteCEC(Button4Address, Blue); break; |
rogermcardell | 0:ea876cfd7385 | 149 | case '3': WriteCEC(Button4Address, Red); break; |
rogermcardell | 0:ea876cfd7385 | 150 | case '4': WriteCEC(Button4Address, FlashRed); break; |
rogermcardell | 0:ea876cfd7385 | 151 | case '5': WriteCEC(Button4Address, FlashRedGreen); break; |
rogermcardell | 0:ea876cfd7385 | 152 | case '6': WriteCEC(Button4Address, FlashBlue); break; |
rogermcardell | 0:ea876cfd7385 | 153 | } |
rogermcardell | 0:ea876cfd7385 | 154 | break; |
rogermcardell | 0:ea876cfd7385 | 155 | } |
rogermcardell | 0:ea876cfd7385 | 156 | } |
rogermcardell | 0:ea876cfd7385 | 157 | break; |
rogermcardell | 0:ea876cfd7385 | 158 | case 'L': |
rogermcardell | 0:ea876cfd7385 | 159 | Processabox(RegBuff); |
rogermcardell | 0:ea876cfd7385 | 160 | // Format: LEXYZ/n |
rogermcardell | 0:ea876cfd7385 | 161 | break; |
rogermcardell | 0:ea876cfd7385 | 162 | } |
rogermcardell | 0:ea876cfd7385 | 163 | RegBuff = ""; |
rogermcardell | 0:ea876cfd7385 | 164 | } |
rogermcardell | 0:ea876cfd7385 | 165 | } |
rogermcardell | 0:ea876cfd7385 | 166 | } |
rogermcardell | 0:ea876cfd7385 | 167 | |
rogermcardell | 0:ea876cfd7385 | 168 | |
rogermcardell | 0:ea876cfd7385 | 169 | void WriteCEC(char Port, char data) |
rogermcardell | 0:ea876cfd7385 | 170 | { |
rogermcardell | 0:ea876cfd7385 | 171 | char SendByte[2]; |
rogermcardell | 0:ea876cfd7385 | 172 | SendByte[0] = '\x01'; |
rogermcardell | 0:ea876cfd7385 | 173 | SendByte[1] = data; |
rogermcardell | 0:ea876cfd7385 | 174 | I2CBus.start(); // Not sure if this is required. |
rogermcardell | 0:ea876cfd7385 | 175 | I2CBus.write(Port, SendByte, 2); |
rogermcardell | 0:ea876cfd7385 | 176 | I2CBus.stop(); |
rogermcardell | 0:ea876cfd7385 | 177 | } |
rogermcardell | 0:ea876cfd7385 | 178 | char ReadCEC(char Port) |
rogermcardell | 0:ea876cfd7385 | 179 | { |
rogermcardell | 0:ea876cfd7385 | 180 | char TempRead[1]; |
rogermcardell | 0:ea876cfd7385 | 181 | char RegAddress = '\x01'; |
rogermcardell | 0:ea876cfd7385 | 182 | I2CBus.start(); // Not sure if this is required. |
rogermcardell | 0:ea876cfd7385 | 183 | I2CBus.write(Port, &RegAddress, 1); // |
rogermcardell | 0:ea876cfd7385 | 184 | I2CBus.read(Port, TempRead, 1); |
rogermcardell | 0:ea876cfd7385 | 185 | I2CBus.stop(); |
rogermcardell | 0:ea876cfd7385 | 186 | |
rogermcardell | 0:ea876cfd7385 | 187 | printf("CEC value is %d: \r\n",TempRead); |
rogermcardell | 0:ea876cfd7385 | 188 | |
rogermcardell | 0:ea876cfd7385 | 189 | return TempRead[0]; |
rogermcardell | 0:ea876cfd7385 | 190 | } |
rogermcardell | 0:ea876cfd7385 | 191 | void ReadEthernet(char Register) |
rogermcardell | 0:ea876cfd7385 | 192 | { |
rogermcardell | 0:ea876cfd7385 | 193 | char TempRead[10]; |
rogermcardell | 0:ea876cfd7385 | 194 | I2CBus.start(); |
rogermcardell | 0:ea876cfd7385 | 195 | I2CBus.write(EthAddWrite, &Register, 1); // |
rogermcardell | 0:ea876cfd7385 | 196 | I2CBus.read(EthAddRead, TempRead, 1); |
rogermcardell | 0:ea876cfd7385 | 197 | I2CBus.stop(); |
rogermcardell | 0:ea876cfd7385 | 198 | |
rogermcardell | 0:ea876cfd7385 | 199 | printf("Ethernet Register %d: \r\n",Register); |
rogermcardell | 0:ea876cfd7385 | 200 | printf("Value is %d: \r\n",TempRead); |
rogermcardell | 0:ea876cfd7385 | 201 | } |
rogermcardell | 0:ea876cfd7385 | 202 | |
rogermcardell | 0:ea876cfd7385 | 203 | |
rogermcardell | 0:ea876cfd7385 | 204 | void CheckaboxData() |
rogermcardell | 0:ea876cfd7385 | 205 | { |
rogermcardell | 0:ea876cfd7385 | 206 | string bufchar; |
rogermcardell | 0:ea876cfd7385 | 207 | string TempString; |
rogermcardell | 0:ea876cfd7385 | 208 | |
rogermcardell | 0:ea876cfd7385 | 209 | char inChar; |
rogermcardell | 0:ea876cfd7385 | 210 | while(aboxPort.readable()) |
rogermcardell | 0:ea876cfd7385 | 211 | { |
rogermcardell | 0:ea876cfd7385 | 212 | inChar = aboxPort.getc(); // get the new byte |
rogermcardell | 0:ea876cfd7385 | 213 | InString1 += inChar; // add it to the inputString: |
rogermcardell | 0:ea876cfd7385 | 214 | |
rogermcardell | 0:ea876cfd7385 | 215 | if (inChar == '\n') |
rogermcardell | 0:ea876cfd7385 | 216 | { |
rogermcardell | 0:ea876cfd7385 | 217 | TempString = InString1; |
rogermcardell | 0:ea876cfd7385 | 218 | InString1 = ""; |
rogermcardell | 0:ea876cfd7385 | 219 | Processabox(TempString); |
rogermcardell | 0:ea876cfd7385 | 220 | } |
rogermcardell | 0:ea876cfd7385 | 221 | } |
rogermcardell | 0:ea876cfd7385 | 222 | } |
rogermcardell | 0:ea876cfd7385 | 223 | void Processabox(string InString) |
rogermcardell | 0:ea876cfd7385 | 224 | { |
rogermcardell | 0:ea876cfd7385 | 225 | // Format: LEXXYYZZ/n where LE is the comand type, X is interface ID, Y is LED number and Z is the LED state. XYZ are hex |
rogermcardell | 0:ea876cfd7385 | 226 | |
rogermcardell | 0:ea876cfd7385 | 227 | uint8_t BoxNo = ((InString[2] - 48)*10) + (InString[3] - 48); // convert from 2 char bytes to 1 byte number |
rogermcardell | 0:ea876cfd7385 | 228 | uint8_t LEDNo = ((InString[4] - 48)*10) + (InString[5] - 48); |
rogermcardell | 0:ea876cfd7385 | 229 | uint8_t LEDState = ((InString[6] - 48)*10) + (InString[7] - 48); |
rogermcardell | 0:ea876cfd7385 | 230 | |
rogermcardell | 0:ea876cfd7385 | 231 | switch (InString[0]) |
rogermcardell | 0:ea876cfd7385 | 232 | { |
rogermcardell | 0:ea876cfd7385 | 233 | case'L': SetLEDs(LEDNo, LEDState); break; |
rogermcardell | 0:ea876cfd7385 | 234 | case'H': |
rogermcardell | 0:ea876cfd7385 | 235 | if (InString[1] == 'B') |
rogermcardell | 0:ea876cfd7385 | 236 | aboxPort.printf("HNTB\n"); |
rogermcardell | 0:ea876cfd7385 | 237 | //Send heartbeat |
rogermcardell | 0:ea876cfd7385 | 238 | break; |
rogermcardell | 0:ea876cfd7385 | 239 | case'M': |
rogermcardell | 0:ea876cfd7385 | 240 | if (InString[1] == 'A') |
rogermcardell | 0:ea876cfd7385 | 241 | { |
rogermcardell | 0:ea876cfd7385 | 242 | |
rogermcardell | 0:ea876cfd7385 | 243 | |
rogermcardell | 0:ea876cfd7385 | 244 | } |
rogermcardell | 0:ea876cfd7385 | 245 | case'U': // Update current status. |
rogermcardell | 0:ea876cfd7385 | 246 | if (HDMI1Sync) |
rogermcardell | 0:ea876cfd7385 | 247 | aboxPort.printf("DSY%d11\n", IDNumber); |
rogermcardell | 0:ea876cfd7385 | 248 | else |
rogermcardell | 0:ea876cfd7385 | 249 | aboxPort.printf("DSY%d10\n", IDNumber); |
rogermcardell | 0:ea876cfd7385 | 250 | if (HDMI2Sync) |
rogermcardell | 0:ea876cfd7385 | 251 | aboxPort.printf("DSY%d21\n", IDNumber); |
rogermcardell | 0:ea876cfd7385 | 252 | else |
rogermcardell | 0:ea876cfd7385 | 253 | aboxPort.printf("DSY%d20\n", IDNumber); |
rogermcardell | 0:ea876cfd7385 | 254 | if (HDMI3Sync) |
rogermcardell | 0:ea876cfd7385 | 255 | aboxPort.printf("DSY%d31\n", IDNumber); |
rogermcardell | 0:ea876cfd7385 | 256 | else |
rogermcardell | 0:ea876cfd7385 | 257 | aboxPort.printf("DSY%d30\n", IDNumber); |
rogermcardell | 0:ea876cfd7385 | 258 | if (HDMI4Sync) |
rogermcardell | 0:ea876cfd7385 | 259 | aboxPort.printf("DSY%d41\n", IDNumber); |
rogermcardell | 0:ea876cfd7385 | 260 | else |
rogermcardell | 0:ea876cfd7385 | 261 | aboxPort.printf("DSY%d40\n", IDNumber); |
rogermcardell | 0:ea876cfd7385 | 262 | break; |
rogermcardell | 0:ea876cfd7385 | 263 | case'V': aboxPort.printf("REV%S\n", Revision.c_str()); break; |
rogermcardell | 0:ea876cfd7385 | 264 | } |
rogermcardell | 0:ea876cfd7385 | 265 | } |
rogermcardell | 0:ea876cfd7385 | 266 | void SetLEDs(uint8_t LEDNo, uint8_t LEDState) |
rogermcardell | 0:ea876cfd7385 | 267 | { |
rogermcardell | 0:ea876cfd7385 | 268 | printf("Set LEDs: LEDNo: %d LEDState: %d \n\r", LEDNo, LEDState ); |
rogermcardell | 0:ea876cfd7385 | 269 | switch(LEDNo) |
rogermcardell | 0:ea876cfd7385 | 270 | { |
rogermcardell | 0:ea876cfd7385 | 271 | case 1: WriteCEC(Button1Address, (LEDNo * 10) + LEDState); break; |
rogermcardell | 0:ea876cfd7385 | 272 | case 2: WriteCEC(Button1Address, (LEDNo * 10) + LEDState); break; |
rogermcardell | 0:ea876cfd7385 | 273 | case 3: WriteCEC(Button1Address, (LEDNo * 10) + LEDState); break; |
rogermcardell | 0:ea876cfd7385 | 274 | case 4: WriteCEC(Button1Address, (LEDNo * 10) + LEDState); break; |
rogermcardell | 0:ea876cfd7385 | 275 | } |
rogermcardell | 0:ea876cfd7385 | 276 | } |
rogermcardell | 0:ea876cfd7385 | 277 |