Rev 1514 | Rev 1516 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 1514 | Rev 1515 | ||
|---|---|---|---|
| Line 2... | Line 2... | ||
| 2 | #include "sns_input.h" |
2 | #include "sns_input.h" |
| 3 | uint8_t pinStatus[8]; |
3 | uint8_t pinStatus[8]; |
| 4 | #define HIGH 1 |
4 | #define HIGH 1 |
| 5 | #define LOW 2 |
5 | #define LOW 2 |
| 6 | #define NOCHANGE 0 |
6 | #define NOCHANGE 0 |
| - | 7 | #define HIGH_NOCH 3 |
|
| - | 8 | #define LOW_NOCH 4 |
|
| - | 9 | ||
| - | 10 | #define IO_HIGH 1 |
|
| - | 11 | #define IO_LOW 0 |
|
| - | 12 | ||
| - | 13 | ||
| 7 | void sns_input_pcint_callback(uint8_t id, uint8_t status) |
14 | void sns_input_pcint_callback(uint8_t id, uint8_t status) |
| 8 | { |
15 | { |
| 9 | #ifdef sns_input_CH0 |
16 | #ifdef sns_input_CH0 |
| 10 | #if sns_input_CH0PCA95xxIO==0 |
17 | #if sns_input_CH0PCA95xxIO==0 |
| 11 | if (id == sns_input_PCINT_CH0) { |
18 | if (id == sns_input_PCINT_CH0) { |
| 12 | if ( |
19 | if (IO_LOW != status) { |
| 13 | pinStatus[0] = HIGH; |
20 | pinStatus[0] = HIGH; |
| 14 | } else { |
21 | } else { |
| 15 | pinStatus[0] = LOW; |
22 | pinStatus[0] = LOW; |
| 16 | } |
23 | } |
| 17 | } |
24 | } |
| 18 | #endif |
25 | #endif |
| 19 | #endif |
26 | #endif |
| 20 | #ifdef sns_input_CH1 |
27 | #ifdef sns_input_CH1 |
| 21 | #if sns_input_CH1PCA95xxIO==0 |
28 | #if sns_input_CH1PCA95xxIO==0 |
| 22 | if (id == sns_input_PCINT_CH1) { |
29 | if (id == sns_input_PCINT_CH1) { |
| 23 | if ( |
30 | if (IO_LOW != status) { |
| 24 | pinStatus[1] = HIGH; |
31 | pinStatus[1] = HIGH; |
| 25 | } else { |
32 | } else { |
| 26 | pinStatus[1] = LOW; |
33 | pinStatus[1] = LOW; |
| 27 | } |
34 | } |
| 28 | } |
35 | } |
| 29 | #endif |
36 | #endif |
| 30 | #endif |
37 | #endif |
| 31 | #ifdef sns_input_CH2 |
38 | #ifdef sns_input_CH2 |
| 32 | #if sns_input_CH2PCA95xxIO==0 |
39 | #if sns_input_CH2PCA95xxIO==0 |
| 33 | if (id == sns_input_PCINT_CH2) { |
40 | if (id == sns_input_PCINT_CH2) { |
| 34 | if ( |
41 | if (IO_LOW != status) { |
| 35 | pinStatus[2] = HIGH; |
42 | pinStatus[2] = HIGH; |
| 36 | } else { |
43 | } else { |
| 37 | pinStatus[2] = LOW; |
44 | pinStatus[2] = LOW; |
| 38 | } |
45 | } |
| 39 | } |
46 | } |
| 40 | #endif |
47 | #endif |
| 41 | #endif |
48 | #endif |
| 42 | #ifdef sns_input_CH3 |
49 | #ifdef sns_input_CH3 |
| 43 | #if sns_input_CH3PCA95xxIO==0 |
50 | #if sns_input_CH3PCA95xxIO==0 |
| 44 | if (id == sns_input_PCINT_CH3) { |
51 | if (id == sns_input_PCINT_CH3) { |
| 45 | if ( |
52 | if (IO_LOW != status) { |
| 46 | pinStatus[3] = HIGH; |
53 | pinStatus[3] = HIGH; |
| 47 | } else { |
54 | } else { |
| 48 | pinStatus[3] = LOW; |
55 | pinStatus[3] = LOW; |
| 49 | } |
56 | } |
| 50 | } |
57 | } |
| 51 | #endif |
58 | #endif |
| 52 | #endif |
59 | #endif |
| 53 | #ifdef sns_input_CH4 |
60 | #ifdef sns_input_CH4 |
| 54 | #if sns_input_CH4PCA95xxIO==0 |
61 | #if sns_input_CH4PCA95xxIO==0 |
| 55 | if (id == sns_input_PCINT_CH4) { |
62 | if (id == sns_input_PCINT_CH4) { |
| 56 | if ( |
63 | if (IO_LOW != status) { |
| 57 | pinStatus[4] = HIGH; |
64 | pinStatus[4] = HIGH; |
| 58 | } else { |
65 | } else { |
| 59 | pinStatus[4] = LOW; |
66 | pinStatus[4] = LOW; |
| 60 | } |
67 | } |
| 61 | } |
68 | } |
| 62 | #endif |
69 | #endif |
| 63 | #endif |
70 | #endif |
| 64 | #ifdef sns_input_CH5 |
71 | #ifdef sns_input_CH5 |
| 65 | #if sns_input_CH5PCA95xxIO==0 |
72 | #if sns_input_CH5PCA95xxIO==0 |
| 66 | if (id == sns_input_PCINT_CH5) { |
73 | if (id == sns_input_PCINT_CH5) { |
| 67 | if ( |
74 | if (IO_LOW != status) { |
| 68 | pinStatus[5] = HIGH; |
75 | pinStatus[5] = HIGH; |
| 69 | } else { |
76 | } else { |
| 70 | pinStatus[5] = LOW; |
77 | pinStatus[5] = LOW; |
| 71 | } |
78 | } |
| 72 | } |
79 | } |
| 73 | #endif |
80 | #endif |
| 74 | #endif |
81 | #endif |
| 75 | #ifdef sns_input_CH6 |
82 | #ifdef sns_input_CH6 |
| 76 | #if sns_input_CH6PCA95xxIO==0 |
83 | #if sns_input_CH6PCA95xxIO==0 |
| 77 | if (id == sns_input_PCINT_CH6) { |
84 | if (id == sns_input_PCINT_CH6) { |
| 78 | if ( |
85 | if (IO_LOW != status) { |
| 79 | pinStatus[6] = HIGH; |
86 | pinStatus[6] = HIGH; |
| 80 | } else { |
87 | } else { |
| 81 | pinStatus[6] = LOW; |
88 | pinStatus[6] = LOW; |
| 82 | } |
89 | } |
| 83 | } |
90 | } |
| 84 | #endif |
91 | #endif |
| 85 | #endif |
92 | #endif |
| 86 | #ifdef sns_input_CH7 |
93 | #ifdef sns_input_CH7 |
| 87 | #if sns_input_CH7PCA95xxIO==0 |
94 | #if sns_input_CH7PCA95xxIO==0 |
| 88 | if (id == sns_input_PCINT_CH7) { |
95 | if (id == sns_input_PCINT_CH7) { |
| 89 | if ( |
96 | if (IO_LOW != status) { |
| 90 | pinStatus[7] = HIGH; |
97 | pinStatus[7] = HIGH; |
| 91 | } else { |
98 | } else { |
| 92 | pinStatus[7] = LOW; |
99 | pinStatus[7] = LOW; |
| 93 | } |
100 | } |
| 94 | } |
101 | } |
| Line 98... | Line 105... | ||
| 98 | 105 | ||
| 99 | #if sns_input_CH0PCA95xxIO==1 | sns_input_CH1PCA95xxIO==1 | sns_input_CH2PCA95xxIO==1 | sns_input_CH3PCA95xxIO==1 | sns_input_CH4PCA95xxIO==1 | sns_input_CH5PCA95xxIO==1 | sns_input_CH6PCA95xxIO==1 | sns_input_CH7PCA95xxIO==1 |
106 | #if sns_input_CH0PCA95xxIO==1 | sns_input_CH1PCA95xxIO==1 | sns_input_CH2PCA95xxIO==1 | sns_input_CH3PCA95xxIO==1 | sns_input_CH4PCA95xxIO==1 | sns_input_CH5PCA95xxIO==1 | sns_input_CH6PCA95xxIO==1 | sns_input_CH7PCA95xxIO==1 |
| 100 | /*void sns_input_PCA95xx_callback(uint16_t status) |
107 | /*void sns_input_PCA95xx_callback(uint16_t status) |
| 101 | { |
108 | { |
| 102 | printf("0x%x\n",status); |
109 | printf("0x%x\n",status); |
| 103 | }*/ |
110 | }*/ |
| 104 | #endif |
111 | #endif |
| - | 112 | ||
| 105 | 113 | ||
| - | 114 | #if sns_input_CH0PCA95xxIO==1 |sns_input_CH1PCA95xxIO==1 | sns_input_CH2PCA95xxIO==1 | sns_input_CH3PCA95xxIO==1 | sns_input_CH4PCA95xxIO==1 | sns_input_CH5PCA95xxIO==1 | sns_input_CH6PCA95xxIO==1 | sns_input_CH7PCA95xxIO==1 |
|
| - | 115 | void sns_input_setPCA95xxPinStatus(void) |
|
| - | 116 | { |
|
| - | 117 | uint16_t status = Pca95xx_GetInputs(); |
|
| - | 118 | #ifdef sns_input_CH0 |
|
| - | 119 | #if sns_input_CH0PCA95xxIO==1 |
|
| - | 120 | if (((status>>sns_input_CH0)&0x1) != IO_LOW) { |
|
| - | 121 | pinStatus[0] = HIGH_NOCH; |
|
| - | 122 | } else { |
|
| - | 123 | pinStatus[0] = LOW_NOCH; |
|
| - | 124 | } |
|
| - | 125 | #endif |
|
| - | 126 | #endif |
|
| - | 127 | #ifdef sns_input_CH1 |
|
| - | 128 | #if sns_input_CH1PCA95xxIO==1 |
|
| - | 129 | if (((status>>sns_input_CH1)&0x1) != IO_LOW) { |
|
| - | 130 | pinStatus[1] = HIGH_NOCH; |
|
| - | 131 | } else { |
|
| - | 132 | pinStatus[1] = LOW_NOCH; |
|
| - | 133 | } |
|
| - | 134 | #endif |
|
| - | 135 | #endif |
|
| - | 136 | #ifdef sns_input_CH2 |
|
| - | 137 | #if sns_input_CH2PCA95xxIO==1 |
|
| - | 138 | if (((status>>sns_input_CH2)&0x1) != IO_LOW) { |
|
| - | 139 | pinStatus[2] = HIGH_NOCH; |
|
| - | 140 | } else { |
|
| - | 141 | pinStatus[2] = LOW_NOCH; |
|
| - | 142 | } |
|
| - | 143 | #endif |
|
| - | 144 | #endif |
|
| - | 145 | #ifdef sns_input_CH3 |
|
| - | 146 | #if sns_input_CH3PCA95xxIO==1 |
|
| - | 147 | if (((status>>sns_input_CH3)&0x1) != IO_LOW) { |
|
| - | 148 | pinStatus[3] = HIGH_NOCH; |
|
| - | 149 | } else { |
|
| - | 150 | pinStatus[3] = LOW_NOCH; |
|
| - | 151 | } |
|
| - | 152 | #endif |
|
| - | 153 | #endif |
|
| - | 154 | #ifdef sns_input_CH4 |
|
| - | 155 | #if sns_input_CH4PCA95xxIO==1 |
|
| - | 156 | if (((status>>sns_input_CH4)&0x1) != IO_LOW) { |
|
| - | 157 | pinStatus[4] = HIGH_NOCH; |
|
| - | 158 | } else { |
|
| - | 159 | pinStatus[4] = LOW_NOCH; |
|
| - | 160 | } |
|
| - | 161 | #endif |
|
| - | 162 | #endif |
|
| - | 163 | #ifdef sns_input_CH5 |
|
| - | 164 | #if sns_input_CH5PCA95xxIO==1 |
|
| - | 165 | if (((status>>sns_input_CH5)&0x1) != IO_LOW) { |
|
| - | 166 | pinStatus[5] = HIGH_NOCH; |
|
| - | 167 | } else { |
|
| - | 168 | pinStatus[5] = LOW_NOCH; |
|
| - | 169 | } |
|
| - | 170 | #endif |
|
| - | 171 | #endif |
|
| - | 172 | #ifdef sns_input_CH6 |
|
| - | 173 | #if sns_input_CH6PCA95xxIO==1 |
|
| - | 174 | if (((status>>sns_input_CH6)&0x1) != IO_LOW) { |
|
| - | 175 | pinStatus[6] = HIGH_NOCH; |
|
| - | 176 | } else { |
|
| - | 177 | pinStatus[6] = LOW_NOCH; |
|
| - | 178 | } |
|
| - | 179 | #endif |
|
| - | 180 | #endif |
|
| - | 181 | #ifdef sns_input_CH7 |
|
| - | 182 | #if sns_input_CH7PCA95xxIO==1 |
|
| - | 183 | if (((status>>sns_input_CH7)&0x1) != IO_LOW) { |
|
| - | 184 | pinStatus[7] = HIGH_NOCH; |
|
| - | 185 | } else { |
|
| - | 186 | pinStatus[7] = LOW_NOCH; |
|
| - | 187 | } |
|
| - | 188 | #endif |
|
| - | 189 | #endif |
|
| - | 190 | } |
|
| - | 191 | #endif |
|
| 106 | 192 | ||
| 107 | void sns_input_Init(void) |
193 | void sns_input_Init(void) |
| 108 | { |
194 | { |
| 109 | 195 | ||
| 110 | #if sns_input_CH0PCA95xxIO==1 |sns_input_CH1PCA95xxIO==1 | sns_input_CH2PCA95xxIO==1 | sns_input_CH3PCA95xxIO==1 | sns_input_CH4PCA95xxIO==1 | sns_input_CH5PCA95xxIO==1 | sns_input_CH6PCA95xxIO==1 | sns_input_CH7PCA95xxIO==1 |
196 | #if sns_input_CH0PCA95xxIO==1 |sns_input_CH1PCA95xxIO==1 | sns_input_CH2PCA95xxIO==1 | sns_input_CH3PCA95xxIO==1 | sns_input_CH4PCA95xxIO==1 | sns_input_CH5PCA95xxIO==1 | sns_input_CH6PCA95xxIO==1 | sns_input_CH7PCA95xxIO==1 |
| 111 | Pca95xx_Init(0); |
197 | Pca95xx_Init(0); |
| - | 198 | /* Currently only polling of ports is implemented */ |
|
| 112 | //Pca95xx_SetCallback(sns_input_PCA95XX_CALLBACK_INDEX, &sns_input_PCA95xx_callback); |
199 | //Pca95xx_SetCallback(sns_input_PCA95XX_CALLBACK_INDEX, &sns_input_PCA95xx_callback); |
| 113 | Timer_SetTimeout(sns_input_PCA95XX_POLL_TIMER, sns_input_PCA95XX_POLL_TIME, TimerTypeFreeRunning, 0); |
200 | Timer_SetTimeout(sns_input_PCA95XX_POLL_TIMER, sns_input_PCA95XX_POLL_TIME, TimerTypeFreeRunning, 0); |
| 114 | #endif |
201 | #endif |
| 115 | 202 | ||
| 116 | pinStatus[0] = NOCHANGE; |
203 | pinStatus[0] = NOCHANGE; |
| Line 201... | Line 288... | ||
| 201 | #endif |
288 | #endif |
| 202 | gpio_set_in(sns_input_CH5); |
289 | gpio_set_in(sns_input_CH5); |
| 203 | Pcint_SetCallbackPin(sns_input_PCINT_CH5, sns_input_CH5, &sns_input_pcint_callback); |
290 | Pcint_SetCallbackPin(sns_input_PCINT_CH5, sns_input_CH5, &sns_input_pcint_callback); |
| 204 | #else |
291 | #else |
| 205 | Pca95xx_set_in(sns_input_CH5); |
292 | Pca95xx_set_in(sns_input_CH5); |
| 206 | #endif |
293 | #endif |
| 207 | index++; |
294 | index++; |
| 208 | #endif |
295 | #endif |
| 209 | #ifdef sns_input_CH6 |
296 | #ifdef sns_input_CH6 |
| 210 | #if sns_input_CH6PCA95xxIO==0 |
297 | #if sns_input_CH6PCA95xxIO==0 |
| 211 | #if (sns_input_CH6_pullup == 1) |
298 | #if (sns_input_CH6_pullup == 1) |
| 212 | gpio_set_pullup(sns_input_CH6); |
299 | gpio_set_pullup(sns_input_CH6); |
| 213 | #else |
300 | #else |
| 214 | gpio_clr_pullup(sns_input_CH6); |
301 | gpio_clr_pullup(sns_input_CH6); |
| 215 | #endif |
302 | #endif |
| 216 | gpio_set_in(sns_input_CH6); |
303 | gpio_set_in(sns_input_CH6); |
| 217 | Pcint_SetCallbackPin(sns_input_PCINT_CH6, sns_input_CH6, &sns_input_pcint_callback); |
304 | Pcint_SetCallbackPin(sns_input_PCINT_CH6, sns_input_CH6, &sns_input_pcint_callback); |
| 218 | #else |
305 | #else |
| 219 | Pca95xx_set_in(sns_input_CH6); |
306 | Pca95xx_set_in(sns_input_CH6); |
| 220 | #endif |
307 | #endif |
| 221 | index++; |
308 | index++; |
| 222 | #endif |
309 | #endif |
| 223 | #ifdef sns_input_CH7 |
310 | #ifdef sns_input_CH7 |
| 224 | #if sns_input_CH7PCA95xxIO==0 |
311 | #if sns_input_CH7PCA95xxIO==0 |
| 225 | #if (sns_input_CH7_pullup == 1) |
312 | #if (sns_input_CH7_pullup == 1) |
| Line 231... | Line 318... | ||
| 231 | Pcint_SetCallbackPin(sns_input_PCINT_CH7, sns_input_CH7, &sns_input_pcint_callback); |
318 | Pcint_SetCallbackPin(sns_input_PCINT_CH7, sns_input_CH7, &sns_input_pcint_callback); |
| 232 | #else |
319 | #else |
| 233 | Pca95xx_set_in(sns_input_CH7); |
320 | Pca95xx_set_in(sns_input_CH7); |
| 234 | #endif |
321 | #endif |
| 235 | index++; |
322 | index++; |
| 236 | #endif |
323 | #endif |
| 237 | // to use PCINt lib, call this function: (the callback function look as a timer callback function) |
- | |
| 238 | // Pcint_SetCallbackPin(sns_input_PCINT, EXP_C , &sns_input_pcint_callback); |
- | |
| 239 | 324 | ||
| 240 | } |
325 | } |
| 241 | 326 | ||
| 242 | void sns_input_Process(void) |
327 | void sns_input_Process(void) |
| 243 | { |
328 | { |
| 244 | ///TODO: IMPLEMENT DEBOUNCE |
329 | ///TODO: IMPLEMENT DEBOUNCE |
| 245 | uint8_t index = 0; |
330 | uint8_t index = 0; |
| 246 | for (index = 0; index < 8; index++) { |
331 | for (index = 0; index < 8; index++) { |
| 247 | if (pinStatus[index] |
332 | if (pinStatus[index] == LOW || pinStatus[index] == HIGH) { |
| 248 | StdCan_Msg_t txMsg; |
333 | StdCan_Msg_t txMsg; |
| 249 | StdCan_Set_class(txMsg.Header, CAN_MODULE_CLASS_SNS); |
334 | StdCan_Set_class(txMsg.Header, CAN_MODULE_CLASS_SNS); |
| 250 | StdCan_Set_direction(txMsg.Header, DIRECTIONFLAG_FROM_OWNER); |
335 | StdCan_Set_direction(txMsg.Header, DIRECTIONFLAG_FROM_OWNER); |
| 251 | txMsg.Header.ModuleType = CAN_MODULE_TYPE_SNS_INPUT; |
336 | txMsg.Header.ModuleType = CAN_MODULE_TYPE_SNS_INPUT; |
| 252 | txMsg.Header.ModuleId = sns_input_ID; |
337 | txMsg.Header.ModuleId = sns_input_ID; |
| 253 | txMsg.Header.Command = CAN_MODULE_CMD_PHYSICAL_PINSTATUS; |
338 | txMsg.Header.Command = CAN_MODULE_CMD_PHYSICAL_PINSTATUS; |
| 254 | txMsg.Length = 2; |
339 | txMsg.Length = 2; |
| 255 | txMsg.Data[0] = index; |
340 | txMsg.Data[0] = index; |
| 256 | if (pinStatus[index] == HIGH) { |
341 | if (pinStatus[index] == HIGH) { |
| 257 | txMsg.Data[1] = CAN_MODULE_ENUM_PHYSICAL_PINSTATUS_STATUS_HIGH; |
342 | txMsg.Data[1] = CAN_MODULE_ENUM_PHYSICAL_PINSTATUS_STATUS_HIGH; |
| - | 343 | pinStatus[index] = HIGH_NOCH; |
|
| 258 | } else { |
344 | } else { |
| 259 | txMsg.Data[1] = CAN_MODULE_ENUM_PHYSICAL_PINSTATUS_STATUS_LOW; |
345 | txMsg.Data[1] = CAN_MODULE_ENUM_PHYSICAL_PINSTATUS_STATUS_LOW; |
| - | 346 | pinStatus[index] = LOW_NOCH; |
|
| 260 | } |
347 | } |
| 261 | pinStatus[index] = NOCHANGE; |
- | |
| 262 | while (StdCan_Put(&txMsg) != StdCan_Ret_OK); |
348 | while (StdCan_Put(&txMsg) != StdCan_Ret_OK); |
| 263 | } |
349 | } |
| 264 | } |
350 | } |
| 265 | 351 | ||
| 266 | #if sns_input_CH0PCA95xxIO==1 | sns_input_CH1PCA95xxIO==1 | sns_input_CH2PCA95xxIO==1 | sns_input_CH3PCA95xxIO==1 | sns_input_CH4PCA95xxIO==1 | sns_input_CH5PCA95xxIO==1 | sns_input_CH6PCA95xxIO==1 | sns_input_CH7PCA95xxIO==1 |
352 | #if sns_input_CH0PCA95xxIO==1 | sns_input_CH1PCA95xxIO==1 | sns_input_CH2PCA95xxIO==1 | sns_input_CH3PCA95xxIO==1 | sns_input_CH4PCA95xxIO==1 | sns_input_CH5PCA95xxIO==1 | sns_input_CH6PCA95xxIO==1 | sns_input_CH7PCA95xxIO==1 |
| - | 353 | /* Currently only polling of PCAxx-inputs is implemented */ |
|
| 267 | if (Timer_Expired(sns_input_PCA95XX_POLL_TIMER)) |
354 | if (Timer_Expired(sns_input_PCA95XX_POLL_TIMER)) |
| 268 | { |
355 | { |
| 269 | uint16_t status = Pca95xx_GetInputs(); |
356 | uint16_t status = Pca95xx_GetInputs(); |
| 270 | #ifdef sns_input_CH0 |
357 | #ifdef sns_input_CH0 |
| 271 | #if sns_input_CH0PCA95xxIO==1 |
358 | #if sns_input_CH0PCA95xxIO==1 |
| 272 |
|
359 | if (pinStatus[0] == LOW_NOCH && ((status>>sns_input_CH0)&0x1) == HIGH) { |
| 273 |
|
360 | pinStatus[0] = HIGH; |
| 274 |
|
361 | } else if (pinStatus[0] == HIGH_NOCH && ((status>>sns_input_CH0)&0x1) == LOW) { |
| 275 | } else { |
- | |
| 276 | pinStatus[0] = LOW; |
362 | pinStatus[0] = LOW; |
| 277 | } |
363 | } |
| - | 364 | #endif |
|
| - | 365 | #endif |
|
| - | 366 | #ifdef sns_input_CH1 |
|
| - | 367 | #if sns_input_CH1PCA95xxIO==1 |
|
| - | 368 | if (pinStatus[1] == LOW_NOCH && ((status>>sns_input_CH1)&0x1) == HIGH) { |
|
| - | 369 | pinStatus[1] = HIGH; |
|
| - | 370 | } else if (pinStatus[1] == HIGH_NOCH && ((status>>sns_input_CH1)&0x1) == LOW) { |
|
| - | 371 | pinStatus[1] = LOW; |
|
| - | 372 | } |
|
| - | 373 | #endif |
|
| - | 374 | #endif |
|
| - | 375 | #ifdef sns_input_CH2 |
|
| - | 376 | #if sns_input_CH2PCA95xxIO==1 |
|
| - | 377 | if (pinStatus[2] == LOW_NOCH && ((status>>sns_input_CH2)&0x1) == HIGH) { |
|
| - | 378 | pinStatus[2] = HIGH; |
|
| - | 379 | } else if (pinStatus[2] == HIGH_NOCH && ((status>>sns_input_CH2)&0x1) == LOW) { |
|
| - | 380 | pinStatus[2] = LOW; |
|
| - | 381 | } |
|
| - | 382 | #endif |
|
| - | 383 | #endif |
|
| - | 384 | #ifdef sns_input_CH3 |
|
| - | 385 | #if sns_input_CH3PCA95xxIO==1 |
|
| - | 386 | if (pinStatus[3] == LOW_NOCH && ((status>>sns_input_CH3)&0x1) == HIGH) { |
|
| - | 387 | pinStatus[3] = HIGH; |
|
| - | 388 | } else if (pinStatus[3] == HIGH_NOCH && ((status>>sns_input_CH3)&0x1) == LOW) { |
|
| - | 389 | pinStatus[3] = LOW; |
|
| - | 390 | } |
|
| - | 391 | #endif |
|
| - | 392 | #endif |
|
| - | 393 | #ifdef sns_input_CH4 |
|
| - | 394 | #if sns_input_CH4PCA95xxIO==1 |
|
| - | 395 | if (pinStatus[4] == LOW_NOCH && ((status>>sns_input_CH4)&0x1) == HIGH) { |
|
| - | 396 | pinStatus[4] = HIGH; |
|
| - | 397 | } else if (pinStatus[4] == HIGH_NOCH && ((status>>sns_input_CH4)&0x1) == LOW) { |
|
| - | 398 | pinStatus[4] = LOW; |
|
| - | 399 | } |
|
| - | 400 | #endif |
|
| - | 401 | #endif |
|
| - | 402 | #ifdef sns_input_CH5 |
|
| - | 403 | #if sns_input_CH5PCA95xxIO==1 |
|
| - | 404 | if (pinStatus[5] == LOW_NOCH && ((status>>sns_input_CH5)&0x1) == HIGH) { |
|
| - | 405 | pinStatus[5] = HIGH; |
|
| - | 406 | } else if (pinStatus[5] == HIGH_NOCH && ((status>>sns_input_CH5)&0x1) == LOW) { |
|
| - | 407 | pinStatus[5] = LOW; |
|
| - | 408 | } |
|
| - | 409 | #endif |
|
| - | 410 | #endif |
|
| - | 411 | #ifdef sns_input_CH6 |
|
| - | 412 | #if sns_input_CH0PCA95xxIO==1 |
|
| - | 413 | if (pinStatus[6] == LOW_NOCH && ((status>>sns_input_CH6)&0x1) == HIGH) { |
|
| - | 414 | pinStatus[6] = HIGH; |
|
| - | 415 | } else if (pinStatus[6] == HIGH_NOCH && ((status>>sns_input_CH6)&0x1) == LOW) { |
|
| - | 416 | pinStatus[6] = LOW; |
|
| - | 417 | } |
|
| - | 418 | #endif |
|
| - | 419 | #endif |
|
| - | 420 | #ifdef sns_input_CH7 |
|
| - | 421 | #if sns_input_CH7PCA95xxIO==1 |
|
| - | 422 | if (pinStatus[7] == LOW_NOCH && ((status>>sns_input_CH7)&0x1) == HIGH) { |
|
| - | 423 | pinStatus[7] = HIGH; |
|
| - | 424 | } else if (pinStatus[7] == HIGH_NOCH && ((status>>sns_input_CH7)&0x1) == LOW) { |
|
| - | 425 | pinStatus[7] = LOW; |
|
| 278 |
|
426 | } |
| 279 | #endif |
427 | #endif |
| 280 | #endif |
428 | #endif |
| 281 | 429 | ||
| 282 | } |
430 | } |
| 283 | #endif |
431 | #endif |