Rev 1509 | Rev 1797 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 1509 | Rev 1519 | ||
|---|---|---|---|
| Line 1... | Line 1... | ||
| 1 | 1 | ||
| 2 | #include "act_output.h" |
2 | #include "act_output.h" |
| - | 3 | ||
| 3 | uint8_t chnValue[ |
4 | uint8_t chnValue[act_output_NUM_SUPPORTED]; |
| - | 5 | ||
| 4 | #ifdef act_output_USEEEPROM |
6 | #ifdef act_output_USEEEPROM |
| 5 | #include "act_output_eeprom.h" |
7 | #include "act_output_eeprom.h" |
| 6 | struct eeprom_act_output EEMEM eeprom_act_output = |
8 | struct eeprom_act_output EEMEM eeprom_act_output = |
| 7 | { |
9 | { |
| 8 | { |
10 | { |
| 9 | ///TODO: Define initialization values on the EEPROM variables here, this will generate a *.eep file that can be used to store this values to the node, can in future be done with a EEPROM module and the make-scrips. Write the values in the exact same order as the struct is defined in the *.h file. |
11 | ///TODO: Define initialization values on the EEPROM variables here, this will generate a *.eep file that can be used to store this values to the node, can in future be done with a EEPROM module and the make-scrips. Write the values in the exact same order as the struct is defined in the *.h file. |
| 10 | #ifdef act_output_CH0 |
12 | #ifdef act_output_CH0 |
| 11 | 0x00, |
13 | 0x00, |
| 12 | #endif |
14 | #endif |
| 13 | #ifdef act_output_CH1 |
15 | #ifdef act_output_CH1 |
| 14 | 0x00, |
16 | 0x00, |
| 15 | #endif |
17 | #endif |
| 16 | #ifdef act_output_CH2 |
18 | #ifdef act_output_CH2 |
| 17 | 0x00, |
19 | 0x00, |
| 18 | #endif |
20 | #endif |
| 19 | #ifdef act_output_CH3 |
21 | #ifdef act_output_CH3 |
| 20 | 0x00, |
22 | 0x00, |
| 21 | #endif |
23 | #endif |
| 22 | #ifdef act_output_CH4 |
24 | #ifdef act_output_CH4 |
| 23 | 0x00, |
25 | 0x00, |
| 24 | #endif |
26 | #endif |
| 25 | #ifdef act_output_CH5 |
27 | #ifdef act_output_CH5 |
| 26 | 0x00, |
28 | 0x00, |
| 27 | #endif |
29 | #endif |
| 28 | #ifdef act_output_CH6 |
30 | #ifdef act_output_CH6 |
| 29 | 0x00, |
31 | 0x00, |
| 30 | #endif |
32 | #endif |
| 31 | #ifdef act_output_CH7 |
33 | #ifdef act_output_CH7 |
| 32 | 0x00, |
34 | 0x00, |
| - | 35 | #endif |
|
| - | 36 | #ifdef act_output_CH8 |
|
| - | 37 | 0x00, |
|
| - | 38 | #endif |
|
| - | 39 | #ifdef act_output_CH9 |
|
| - | 40 | 0x00, |
|
| 33 | #endif |
41 | #endif |
| 34 | }, |
42 | }, |
| 35 | 0 // crc, must be a correct value, but this will also be handled by the EEPROM module or make scripts |
43 | 0 // crc, must be a correct value, but this will also be handled by the EEPROM module or make scripts |
| 36 | }; |
44 | }; |
| 37 | #endif |
45 | #endif |
| Line 43... | Line 51... | ||
| 43 | { |
51 | { |
| 44 | ///TODO: Use stored data to set initial values for the module |
52 | ///TODO: Use stored data to set initial values for the module |
| 45 | uint8_t index = 0; |
53 | uint8_t index = 0; |
| 46 | #ifdef act_output_CH0 |
54 | #ifdef act_output_CH0 |
| 47 | chnValue[index] = eeprom_read_byte(EEDATA.ch0); |
55 | chnValue[index] = eeprom_read_byte(EEDATA.ch0); |
| 48 | index++; |
56 | index++; |
| 49 | #endif |
57 | #endif |
| 50 | #ifdef act_output_CH1 |
58 | #ifdef act_output_CH1 |
| 51 | chnValue[index] = eeprom_read_byte(EEDATA.ch1); |
59 | chnValue[index] = eeprom_read_byte(EEDATA.ch1); |
| 52 | index++; |
60 | index++; |
| 53 | #endif |
61 | #endif |
| 54 | #ifdef act_output_CH2 |
62 | #ifdef act_output_CH2 |
| 55 | chnValue[index] = eeprom_read_byte(EEDATA.ch2); |
63 | chnValue[index] = eeprom_read_byte(EEDATA.ch2); |
| 56 | index++; |
64 | index++; |
| 57 | #endif |
65 | #endif |
| 58 | #ifdef act_output_CH3 |
66 | #ifdef act_output_CH3 |
| 59 | chnValue[index] = eeprom_read_byte(EEDATA.ch3); |
67 | chnValue[index] = eeprom_read_byte(EEDATA.ch3); |
| 60 | index++; |
68 | index++; |
| 61 | #endif |
69 | #endif |
| 62 | #ifdef act_output_CH4 |
70 | #ifdef act_output_CH4 |
| 63 | chnValue[index] = eeprom_read_byte(EEDATA.ch4); |
71 | chnValue[index] = eeprom_read_byte(EEDATA.ch4); |
| 64 | index++; |
72 | index++; |
| 65 | #endif |
73 | #endif |
| 66 | #ifdef act_output_CH5 |
74 | #ifdef act_output_CH5 |
| 67 | chnValue[index] = eeprom_read_byte(EEDATA.ch5); |
75 | chnValue[index] = eeprom_read_byte(EEDATA.ch5); |
| 68 | index++; |
76 | index++; |
| 69 | #endif |
77 | #endif |
| 70 | #ifdef act_output_CH6 |
78 | #ifdef act_output_CH6 |
| 71 | chnValue[index] = eeprom_read_byte(EEDATA.ch6); |
79 | chnValue[index] = eeprom_read_byte(EEDATA.ch6); |
| 72 | index++; |
80 | index++; |
| 73 | #endif |
81 | #endif |
| 74 | #ifdef act_output_CH7 |
82 | #ifdef act_output_CH7 |
| 75 | chnValue[index] = eeprom_read_byte(EEDATA.ch7); |
83 | chnValue[index] = eeprom_read_byte(EEDATA.ch7); |
| - | 84 | index++; |
|
| - | 85 | #endif |
|
| - | 86 | #ifdef act_output_CH8 |
|
| - | 87 | chnValue[index] = eeprom_read_byte(EEDATA.ch8); |
|
| - | 88 | index++; |
|
| - | 89 | #endif |
|
| - | 90 | #ifdef act_output_CH9 |
|
| - | 91 | chnValue[index] = eeprom_read_byte(EEDATA.ch9); |
|
| 76 | index++; |
92 | index++; |
| 77 | #endif |
93 | #endif |
| 78 | } else |
94 | } else |
| 79 | { //The CRC of the EEPROM is not correct, store default values and update CRC |
95 | { //The CRC of the EEPROM is not correct, store default values and update CRC |
| 80 | #ifdef act_output_CH0 |
96 | #ifdef act_output_CH0 |
| Line 92... | Line 108... | ||
| 92 | #ifdef act_output_CH4 |
108 | #ifdef act_output_CH4 |
| 93 | eeprom_write_byte_crc(EEDATA.ch4, 0x00, WITHOUT_CRC); |
109 | eeprom_write_byte_crc(EEDATA.ch4, 0x00, WITHOUT_CRC); |
| 94 | #endif |
110 | #endif |
| 95 | #ifdef act_output_CH5 |
111 | #ifdef act_output_CH5 |
| 96 | eeprom_write_byte_crc(EEDATA.ch5, 0x00, WITHOUT_CRC); |
112 | eeprom_write_byte_crc(EEDATA.ch5, 0x00, WITHOUT_CRC); |
| 97 | #endif |
113 | #endif |
| 98 | #ifdef act_output_CH6 |
114 | #ifdef act_output_CH6 |
| 99 | eeprom_write_byte_crc(EEDATA.ch6, 0x00, WITHOUT_CRC); |
115 | eeprom_write_byte_crc(EEDATA.ch6, 0x00, WITHOUT_CRC); |
| 100 | #endif |
116 | #endif |
| 101 | #ifdef act_output_CH7 |
117 | #ifdef act_output_CH7 |
| 102 | eeprom_write_byte_crc(EEDATA.ch7, 0x00, WITHOUT_CRC); |
118 | eeprom_write_byte_crc(EEDATA.ch7, 0x00, WITHOUT_CRC); |
| 103 | #endif |
119 | #endif |
| - | 120 | #ifdef act_output_CH8 |
|
| - | 121 | eeprom_write_byte_crc(EEDATA.ch8, 0x00, WITHOUT_CRC); |
|
| - | 122 | #endif |
|
| - | 123 | #ifdef act_output_CH9 |
|
| - | 124 | eeprom_write_byte_crc(EEDATA.ch9, 0x00, WITHOUT_CRC); |
|
| - | 125 | #endif |
|
| 104 | EEDATA_UPDATE_CRC; |
126 | EEDATA_UPDATE_CRC; |
| 105 | } |
127 | } |
| 106 | #endif |
128 | #endif |
| 107 | ///Initialize hardware |
129 | ///Initialize hardware |
| 108 | uint8_t index = 0; |
130 | uint8_t index = 0; |
| 109 | 131 | ||
| 110 | #if act_output_CH0PCA95xxIO==1 |act_output_CH1PCA95xxIO==1 | act_output_CH2PCA95xxIO==1 | act_output_CH3PCA95xxIO==1 | act_output_CH4PCA95xxIO==1 | act_output_CH5PCA95xxIO==1 | act_output_CH6PCA95xxIO==1 | act_output_CH7PCA95xxIO==1 |
132 | #if act_output_CH0PCA95xxIO==1 |act_output_CH1PCA95xxIO==1 | act_output_CH2PCA95xxIO==1 | act_output_CH3PCA95xxIO==1 | act_output_CH4PCA95xxIO==1 | act_output_CH5PCA95xxIO==1 | act_output_CH6PCA95xxIO==1 | act_output_CH7PCA95xxIO==1 |
| 111 | Pca95xx_Init(0); |
133 | Pca95xx_Init(0); |
| 112 | #endif |
134 | #endif |
| 113 | 135 | ||
| 114 | #ifdef act_output_CH0 |
136 | #ifdef act_output_CH0 |
| Line 136... | Line 158... | ||
| 136 | gpio_set_statement(chnValue[index],act_output_CH2); |
158 | gpio_set_statement(chnValue[index],act_output_CH2); |
| 137 | gpio_set_out(act_output_CH2); |
159 | gpio_set_out(act_output_CH2); |
| 138 | #else |
160 | #else |
| 139 | Pca95xx_set_statement(chnValue[index],act_output_CH2); |
161 | Pca95xx_set_statement(chnValue[index],act_output_CH2); |
| 140 | Pca95xx_set_out(act_output_CH2); |
162 | Pca95xx_set_out(act_output_CH2); |
| 141 | #endif |
163 | #endif |
| 142 | index++; |
164 | index++; |
| 143 | #endif |
165 | #endif |
| 144 | #ifdef act_output_CH3 |
166 | #ifdef act_output_CH3 |
| 145 | #if act_output_CH3PCA95xxIO==0 |
167 | #if act_output_CH3PCA95xxIO==0 |
| 146 | gpio_set_statement(chnValue[index],act_output_CH3); |
168 | gpio_set_statement(chnValue[index],act_output_CH3); |
| 147 | gpio_set_out(act_output_CH3); |
169 | gpio_set_out(act_output_CH3); |
| 148 | #else |
170 | #else |
| Line 189... | Line 211... | ||
| 189 | Pca95xx_set_statement(chnValue[index],act_output_CH7); |
211 | Pca95xx_set_statement(chnValue[index],act_output_CH7); |
| 190 | Pca95xx_set_out(act_output_CH7); |
212 | Pca95xx_set_out(act_output_CH7); |
| 191 | #endif |
213 | #endif |
| 192 | index++; |
214 | index++; |
| 193 | #endif |
215 | #endif |
| - | 216 | #ifdef act_output_CH8 |
|
| - | 217 | #if act_output_CH8PCA95xxIO==0 |
|
| 194 |
|
218 | gpio_set_statement(chnValue[index],act_output_CH8); |
| - | 219 | gpio_set_out(act_output_CH8); |
|
| - | 220 | #else |
|
| 195 |
|
221 | Pca95xx_set_statement(chnValue[index],act_output_CH8); |
| - | 222 | Pca95xx_set_out(act_output_CH8); |
|
| - | 223 | #endif |
|
| - | 224 | index++; |
|
| - | 225 | #endif |
|
| - | 226 | #ifdef act_output_CH9 |
|
| - | 227 | #if act_output_CH9PCA95xxIO==0 |
|
| - | 228 | gpio_set_statement(chnValue[index],act_output_CH9); |
|
| - | 229 | gpio_set_out(act_output_CH9); |
|
| - | 230 | #else |
|
| - | 231 | Pca95xx_set_statement(chnValue[index],act_output_CH9); |
|
| - | 232 | Pca95xx_set_out(act_output_CH9); |
|
| - | 233 | #endif |
|
| - | 234 | index++; |
|
| - | 235 | #endif |
|
| 196 | 236 | ||
| 197 | } |
237 | } |
| 198 | 238 | ||
| 199 | void act_output_Process(void) |
239 | void act_output_Process(void) |
| 200 | { |
240 | { |
| 201 | if (Timer_Expired(act_output_STORE_VALUE_TIMEOUT)) |
241 | if (Timer_Expired(act_output_STORE_VALUE_TIMEOUT)) |
| 202 | { |
242 | { |
| 203 | uint8_t index = 0; |
243 | uint8_t index = 0; |
| 204 | #ifdef act_output_CH0 |
244 | #ifdef act_output_CH0 |
| 205 | eeprom_write_byte_crc(EEDATA.ch0, chnValue[index], WITHOUT_CRC); |
245 | eeprom_write_byte_crc(EEDATA.ch0, chnValue[index], WITHOUT_CRC); |
| 206 | index++; |
246 | index++; |
| 207 | #endif |
247 | #endif |
| 208 | #ifdef act_output_CH1 |
248 | #ifdef act_output_CH1 |
| 209 | eeprom_write_byte_crc(EEDATA.ch1, chnValue[index], WITHOUT_CRC); |
249 | eeprom_write_byte_crc(EEDATA.ch1, chnValue[index], WITHOUT_CRC); |
| 210 | index++; |
250 | index++; |
| 211 | #endif |
251 | #endif |
| Line 217... | Line 257... | ||
| 217 | eeprom_write_byte_crc(EEDATA.ch3, chnValue[index], WITHOUT_CRC); |
257 | eeprom_write_byte_crc(EEDATA.ch3, chnValue[index], WITHOUT_CRC); |
| 218 | index++; |
258 | index++; |
| 219 | #endif |
259 | #endif |
| 220 | #ifdef act_output_CH4 |
260 | #ifdef act_output_CH4 |
| 221 | eeprom_write_byte_crc(EEDATA.ch4, chnValue[index], WITHOUT_CRC); |
261 | eeprom_write_byte_crc(EEDATA.ch4, chnValue[index], WITHOUT_CRC); |
| 222 | index++; |
262 | index++; |
| 223 | #endif |
263 | #endif |
| 224 | #ifdef act_output_CH5 |
264 | #ifdef act_output_CH5 |
| 225 | eeprom_write_byte_crc(EEDATA.ch5, chnValue[index], WITHOUT_CRC); |
265 | eeprom_write_byte_crc(EEDATA.ch5, chnValue[index], WITHOUT_CRC); |
| 226 | index++; |
266 | index++; |
| 227 | #endif |
267 | #endif |
| 228 | #ifdef act_output_CH6 |
268 | #ifdef act_output_CH6 |
| 229 | eeprom_write_byte_crc(EEDATA.ch6, chnValue[index], WITHOUT_CRC); |
269 | eeprom_write_byte_crc(EEDATA.ch6, chnValue[index], WITHOUT_CRC); |
| 230 | index++; |
270 | index++; |
| 231 | #endif |
271 | #endif |
| 232 | #ifdef act_output_CH7 |
272 | #ifdef act_output_CH7 |
| 233 | eeprom_write_byte_crc(EEDATA.ch7, chnValue[index], WITHOUT_CRC); |
273 | eeprom_write_byte_crc(EEDATA.ch7, chnValue[index], WITHOUT_CRC); |
| - | 274 | index++; |
|
| - | 275 | #endif |
|
| - | 276 | #ifdef act_output_CH8 |
|
| - | 277 | eeprom_write_byte_crc(EEDATA.ch8, chnValue[index], WITHOUT_CRC); |
|
| - | 278 | index++; |
|
| - | 279 | #endif |
|
| - | 280 | #ifdef act_output_CH9 |
|
| - | 281 | eeprom_write_byte_crc(EEDATA.ch9, chnValue[index], WITHOUT_CRC); |
|
| 234 | index++; |
282 | index++; |
| 235 | #endif |
283 | #endif |
| 236 | EEDATA_UPDATE_CRC; |
284 | EEDATA_UPDATE_CRC; |
| 237 | } |
285 | } |
| 238 | } |
286 | } |
| 239 | 287 | ||
| 240 | void act_output_HandleMessage(StdCan_Msg_t *rxMsg) |
288 | void act_output_HandleMessage(StdCan_Msg_t *rxMsg) |
| 241 | { |
289 | { |
| 242 | if ( StdCan_Ret_class(rxMsg->Header) == CAN_MODULE_CLASS_ACT && |
290 | if ( StdCan_Ret_class(rxMsg->Header) == CAN_MODULE_CLASS_ACT && |
| 243 | StdCan_Ret_direction(rxMsg->Header) == DIRECTIONFLAG_TO_OWNER && |
291 | StdCan_Ret_direction(rxMsg->Header) == DIRECTIONFLAG_TO_OWNER && |
| 244 | rxMsg->Header.ModuleType == CAN_MODULE_TYPE_ACT_OUTPUT && |
292 | rxMsg->Header.ModuleType == CAN_MODULE_TYPE_ACT_OUTPUT && |
| Line 252... | Line 300... | ||
| 252 | 300 | ||
| 253 | index = 0; |
301 | index = 0; |
| 254 | if (rxMsg->Length == 2) { |
302 | if (rxMsg->Length == 2) { |
| 255 | #ifdef act_output_CH0 |
303 | #ifdef act_output_CH0 |
| 256 | if (rxMsg->Data[0] == 0) { |
304 | if (rxMsg->Data[0] == 0) { |
| 257 | chnValue[index] = rxMsg->Data[1]; |
305 | chnValue[index] = rxMsg->Data[1]; |
| 258 | #if act_output_CH0PCA95xxIO==0 |
306 | #if act_output_CH0PCA95xxIO==0 |
| 259 | gpio_set_statement(chnValue[index],act_output_CH0); |
307 | gpio_set_statement(chnValue[index],act_output_CH0); |
| 260 | #else |
308 | #else |
| 261 | Pca95xx_set_statement(chnValue[index],act_output_CH0); |
309 | Pca95xx_set_statement(chnValue[index],act_output_CH0); |
| 262 | #endif |
310 | #endif |
| 263 | } |
311 | } |
| 264 | index++; |
312 | index++; |
| 265 | #endif |
313 | #endif |
| 266 | #ifdef act_output_CH1 |
314 | #ifdef act_output_CH1 |
| 267 | if (rxMsg->Data[0] == 1) { |
315 | if (rxMsg->Data[0] == 1) { |
| 268 | chnValue[index] = rxMsg->Data[1]; |
316 | chnValue[index] = rxMsg->Data[1]; |
| 269 | #if act_output_CH1PCA95xxIO==0 |
317 | #if act_output_CH1PCA95xxIO==0 |
| 270 | gpio_set_statement(chnValue[index],act_output_CH1); |
318 | gpio_set_statement(chnValue[index],act_output_CH1); |
| 271 | #else |
319 | #else |
| 272 | Pca95xx_set_statement(chnValue[index],act_output_CH1); |
320 | Pca95xx_set_statement(chnValue[index],act_output_CH1); |
| 273 | #endif |
321 | #endif |
| Line 279... | Line 327... | ||
| 279 | chnValue[index] = rxMsg->Data[1]; |
327 | chnValue[index] = rxMsg->Data[1]; |
| 280 | #if act_output_CH2PCA95xxIO==0 |
328 | #if act_output_CH2PCA95xxIO==0 |
| 281 | gpio_set_statement(chnValue[index],act_output_CH2); |
329 | gpio_set_statement(chnValue[index],act_output_CH2); |
| 282 | #else |
330 | #else |
| 283 | Pca95xx_set_statement(chnValue[index],act_output_CH2); |
331 | Pca95xx_set_statement(chnValue[index],act_output_CH2); |
| 284 | #endif |
332 | #endif |
| 285 | } |
333 | } |
| 286 | index++; |
334 | index++; |
| 287 | #endif |
335 | #endif |
| 288 | #ifdef act_output_CH3 |
336 | #ifdef act_output_CH3 |
| 289 | if (rxMsg->Data[0] == 3) { |
337 | if (rxMsg->Data[0] == 3) { |
| 290 | chnValue[index] = rxMsg->Data[1]; |
338 | chnValue[index] = rxMsg->Data[1]; |
| 291 | #if act_output_CH3PCA95xxIO==0 |
339 | #if act_output_CH3PCA95xxIO==0 |
| 292 | gpio_set_statement(chnValue[index],act_output_CH3); |
340 | gpio_set_statement(chnValue[index],act_output_CH3); |
| 293 | #else |
341 | #else |
| 294 | Pca95xx_set_statement(chnValue[index],act_output_CH3); |
342 | Pca95xx_set_statement(chnValue[index],act_output_CH3); |
| 295 | #endif |
343 | #endif |
| 296 | } |
344 | } |
| 297 | index++; |
345 | index++; |
| 298 | #endif |
346 | #endif |
| 299 | #ifdef act_output_CH4 |
347 | #ifdef act_output_CH4 |
| 300 | if (rxMsg->Data[0] == 4) { |
348 | if (rxMsg->Data[0] == 4) { |
| 301 | chnValue[index] = rxMsg->Data[1]; |
349 | chnValue[index] = rxMsg->Data[1]; |
| 302 | #if act_output_CH4PCA95xxIO==0 |
350 | #if act_output_CH4PCA95xxIO==0 |
| 303 | gpio_set_statement(chnValue[index],act_output_CH4); |
351 | gpio_set_statement(chnValue[index],act_output_CH4); |
| 304 | #else |
352 | #else |
| - | 353 | ||
| 305 | Pca95xx_set_statement(chnValue[index],act_output_CH4); |
354 | Pca95xx_set_statement(chnValue[index],act_output_CH4); |
| 306 | #endif |
355 | #endif |
| 307 | } |
356 | } |
| 308 | index++; |
357 | index++; |
| 309 | #endif |
358 | #endif |
| Line 323... | Line 372... | ||
| 323 | chnValue[index] = rxMsg->Data[1]; |
372 | chnValue[index] = rxMsg->Data[1]; |
| 324 | #if act_output_CH6PCA95xxIO==0 |
373 | #if act_output_CH6PCA95xxIO==0 |
| 325 | gpio_set_statement(chnValue[index],act_output_CH6); |
374 | gpio_set_statement(chnValue[index],act_output_CH6); |
| 326 | #else |
375 | #else |
| 327 | Pca95xx_set_statement(chnValue[index],act_output_CH6); |
376 | Pca95xx_set_statement(chnValue[index],act_output_CH6); |
| 328 | #endif |
377 | #endif |
| 329 | } |
378 | } |
| 330 | index++; |
379 | index++; |
| 331 | #endif |
380 | #endif |
| 332 | #ifdef act_output_CH7 |
381 | #ifdef act_output_CH7 |
| 333 | if (rxMsg->Data[0] == 7) { |
382 | if (rxMsg->Data[0] == 7) { |
| 334 | chnValue[index] = rxMsg->Data[1]; |
383 | chnValue[index] = rxMsg->Data[1]; |
| 335 | #if act_output_CH7PCA95xxIO==0 |
384 | #if act_output_CH7PCA95xxIO==0 |
| 336 | gpio_set_statement(chnValue[index],act_output_CH7); |
385 | gpio_set_statement(chnValue[index],act_output_CH7); |
| 337 | #else |
386 | #else |
| 338 | Pca95xx_set_statement(chnValue[index],act_output_CH7); |
387 | Pca95xx_set_statement(chnValue[index],act_output_CH7); |
| - | 388 | #endif |
|
| - | 389 | } |
|
| - | 390 | index++; |
|
| - | 391 | #endif |
|
| - | 392 | #ifdef act_output_CH8 |
|
| - | 393 | if (rxMsg->Data[0] == 8) { |
|
| - | 394 | chnValue[index] = rxMsg->Data[1]; |
|
| - | 395 | #if act_output_CH8PCA95xxIO==0 |
|
| - | 396 | gpio_set_statement(chnValue[index],act_output_CH8); |
|
| - | 397 | #else |
|
| - | 398 | Pca95xx_set_statement(chnValue[index],act_output_CH8); |
|
| - | 399 | #endif |
|
| - | 400 | } |
|
| - | 401 | index++; |
|
| - | 402 | #endif |
|
| - | 403 | #ifdef act_output_CH9 |
|
| - | 404 | if (rxMsg->Data[0] == 9) { |
|
| - | 405 | chnValue[index] = rxMsg->Data[1]; |
|
| - | 406 | #if act_output_CH9PCA95xxIO==0 |
|
| - | 407 | gpio_set_statement(chnValue[index],act_output_CH9); |
|
| - | 408 | #else |
|
| - | 409 | Pca95xx_set_statement(chnValue[index],act_output_CH9); |
|
| 339 | #endif |
410 | #endif |
| 340 | } |
411 | } |
| 341 | index++; |
412 | index++; |
| 342 | #endif |
413 | #endif |
| 343 | Timer_SetTimeout(act_output_STORE_VALUE_TIMEOUT, act_output_STORE_VALUE_TIMEOUT_TIME_S*1000, TimerTypeOneShot, 0); |
414 | Timer_SetTimeout(act_output_STORE_VALUE_TIMEOUT, act_output_STORE_VALUE_TIMEOUT_TIME_S*1000, TimerTypeOneShot, 0); |
| Line 350... | Line 421... | ||
| 350 | if (rxMsg->Data[0] == 0) {value = chnValue[index];} |
421 | if (rxMsg->Data[0] == 0) {value = chnValue[index];} |
| 351 | index++; |
422 | index++; |
| 352 | #endif |
423 | #endif |
| 353 | #ifdef act_output_CH1 |
424 | #ifdef act_output_CH1 |
| 354 | if (rxMsg->Data[0] == 1) {value = chnValue[index];} |
425 | if (rxMsg->Data[0] == 1) {value = chnValue[index];} |
| 355 | index++; |
426 | index++; |
| 356 | #endif |
427 | #endif |
| 357 | #ifdef act_output_CH2 |
428 | #ifdef act_output_CH2 |
| 358 | if (rxMsg->Data[0] == 2) {value = chnValue[index];} |
429 | if (rxMsg->Data[0] == 2) {value = chnValue[index];} |
| 359 | index++; |
430 | index++; |
| 360 | #endif |
431 | #endif |
| Line 362... | Line 433... | ||
| 362 | if (rxMsg->Data[0] == 3) {value = chnValue[index];} |
433 | if (rxMsg->Data[0] == 3) {value = chnValue[index];} |
| 363 | index++; |
434 | index++; |
| 364 | #endif |
435 | #endif |
| 365 | #ifdef act_output_CH4 |
436 | #ifdef act_output_CH4 |
| 366 | if (rxMsg->Data[0] == 4) {value = chnValue[index];} |
437 | if (rxMsg->Data[0] == 4) {value = chnValue[index];} |
| 367 | index++; |
438 | index++; |
| 368 | #endif |
439 | #endif |
| 369 | #ifdef act_output_CH5 |
440 | #ifdef act_output_CH5 |
| 370 | if (rxMsg->Data[0] == 5) {value = chnValue[index];} |
441 | if (rxMsg->Data[0] == 5) {value = chnValue[index];} |
| 371 | index++; |
442 | index++; |
| 372 | #endif |
443 | #endif |
| Line 374... | Line 445... | ||
| 374 | if (rxMsg->Data[0] == 6) {value = chnValue[index];} |
445 | if (rxMsg->Data[0] == 6) {value = chnValue[index];} |
| 375 | index++; |
446 | index++; |
| 376 | #endif |
447 | #endif |
| 377 | #ifdef act_output_CH7 |
448 | #ifdef act_output_CH7 |
| 378 | if (rxMsg->Data[0] == 7) {value = chnValue[index];} |
449 | if (rxMsg->Data[0] == 7) {value = chnValue[index];} |
| - | 450 | index++; |
|
| - | 451 | #endif |
|
| - | 452 | #ifdef act_output_CH8 |
|
| - | 453 | if (rxMsg->Data[0] == 8) {value = chnValue[index];} |
|
| - | 454 | index++; |
|
| - | 455 | #endif |
|
| - | 456 | #ifdef act_output_CH9 |
|
| - | 457 | if (rxMsg->Data[0] == 9) {value = chnValue[index];} |
|
| 379 | index++; |
458 | index++; |
| 380 | #endif |
459 | #endif |
| 381 | rxMsg->Data[1] = value; |
460 | rxMsg->Data[1] = value; |
| 382 | StdCan_Set_direction(rxMsg->Header, DIRECTIONFLAG_FROM_OWNER); |
461 | StdCan_Set_direction(rxMsg->Header, DIRECTIONFLAG_FROM_OWNER); |
| 383 | rxMsg->Length = 2; |
462 | rxMsg->Length = 2; |