Rev 1910 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 1910 | Rev 1977 | ||
|---|---|---|---|
| Line 1... | Line 1... | ||
| 1 | 1 | ||
| 2 | #include "act_output.h" |
2 | #include "act_output.h" |
| 3 | 3 | ||
| 4 | uint8_t chnValue[act_output_NUM_SUPPORTED]; |
4 | uint8_t chnValue[act_output_NUM_SUPPORTED]; |
| 5 | 5 | ||
| 6 | |
6 | #if act_output_USEEEPROM==1 |
| 7 | #include "act_output_eeprom.h" |
7 | #include "act_output_eeprom.h" |
| 8 | struct eeprom_act_output EEMEM eeprom_act_output = |
8 | struct eeprom_act_output EEMEM eeprom_act_output = |
| 9 | { |
9 | { |
| 10 | { |
10 | { |
| 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. |
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. |
| Line 44... | Line 44... | ||
| 44 | }; |
44 | }; |
| 45 | #endif |
45 | #endif |
| 46 | 46 | ||
| 47 | void act_output_Init(void) |
47 | void act_output_Init(void) |
| 48 | { |
48 | { |
| 49 | |
49 | #if act_output_USEEEPROM==1 |
| 50 | if (EEDATA_OK) |
50 | if (EEDATA_OK) |
| 51 | { |
51 | { |
| 52 | ///TODO: Use stored data to set initial values for the module |
52 | ///TODO: Use stored data to set initial values for the module |
| 53 | uint8_t index = 0; |
53 | uint8_t index = 0; |
| 54 | #ifdef act_output_CH0 |
54 | #ifdef act_output_CH0 |
| Line 236... | Line 236... | ||
| 236 | 236 | ||
| 237 | } |
237 | } |
| 238 | 238 | ||
| 239 | void act_output_Process(void) |
239 | void act_output_Process(void) |
| 240 | { |
240 | { |
| 241 | |
241 | #if act_output_USEEEPROM==1 |
| 242 | if (Timer_Expired(act_output_STORE_VALUE_TIMEOUT)) |
242 | if (Timer_Expired(act_output_STORE_VALUE_TIMEOUT)) |
| 243 | { |
243 | { |
| 244 | uint8_t index = 0; |
244 | uint8_t index = 0; |
| 245 | #ifdef act_output_CH0 |
245 | #ifdef act_output_CH0 |
| 246 | eeprom_write_byte_crc(EEDATA.ch0, chnValue[index], WITHOUT_CRC); |
246 | eeprom_write_byte_crc(EEDATA.ch0, chnValue[index], WITHOUT_CRC); |