Rev 1561 | Rev 1582 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 1561 | Rev 1575 | ||
|---|---|---|---|
| Line 111... | Line 111... | ||
| 111 | baudRate = eeprom_read_dword(EEDATA32.baudRate); |
111 | baudRate = eeprom_read_dword(EEDATA32.baudRate); |
| 112 | #else |
112 | #else |
| 113 | #warning This version of AVR-libc does not have support for eeprom read dword |
113 | #warning This version of AVR-libc does not have support for eeprom read dword |
| 114 | #endif |
114 | #endif |
| 115 | format = eeprom_read_word(EEDATA16.format); |
115 | format = eeprom_read_word(EEDATA16.format); |
| 116 | // printf("y\n"); |
- | |
| 117 | } |
116 | } |
| 118 | else { |
117 | else { |
| 119 | //The CRC of the EEPROM is not correct, store default values and update CRC |
118 | //The CRC of the EEPROM is not correct, store default values and update CRC |
| 120 | #if ((__AVR_LIBC_MAJOR__ == 1 && __AVR_LIBC_MINOR__ == 6 && __AVR_LIBC_REVISION__ >=2)||(__AVR_LIBC_MAJOR__ == 1 && __AVR_LIBC_MINOR__ > 6)||__AVR_LIBC_MAJOR__ > 1) |
119 | #if ((__AVR_LIBC_MAJOR__ == 1 && __AVR_LIBC_MINOR__ == 6 && __AVR_LIBC_REVISION__ >=2)||(__AVR_LIBC_MAJOR__ == 1 && __AVR_LIBC_MINOR__ > 6)||__AVR_LIBC_MAJOR__ > 1) |
| 121 | eeprom_write_dword_crc(EEDATA32.baudRate, 9600, WITHOUT_CRC); |
120 | eeprom_write_dword_crc(EEDATA32.baudRate, 9600, WITHOUT_CRC); |
| 122 | #else |
121 | #else |
| 123 | #warning This version of AVR-libc does not have support for eeprom write dword |
122 | #warning This version of AVR-libc does not have support for eeprom write dword |
| 124 | #endif |
123 | #endif |
| 125 | eeprom_write_word_crc(EEDATA16.format, CAN_MODULE_ENUM_SERIAL_SERIALCONFIG_PHYSICALFORMAT_LOOPBACK, WITHOUT_CRC); |
124 | eeprom_write_word_crc(EEDATA16.format, CAN_MODULE_ENUM_SERIAL_SERIALCONFIG_PHYSICALFORMAT_LOOPBACK, WITHOUT_CRC); |
| 126 | EEDATA_UPDATE_CRC; |
125 | EEDATA_UPDATE_CRC; |
| 127 | // printf("z\n"); |
- | |
| 128 | } |
126 | } |
| 129 | #endif |
127 | #endif |
| 130 | // default baudrate |
128 | // default baudrate |
| 131 | uart_init(UART_BAUD_SELECT(baudRate, F_CPU)); |
129 | uart_init(UART_BAUD_SELECT(baudRate, F_CPU)); |
| 132 | 130 | ||
| Line 229... | Line 227... | ||
| 229 | #else |
227 | #else |
| 230 | #warning This version of AVR-libc does not have support for eeprom read dword |
228 | #warning This version of AVR-libc does not have support for eeprom read dword |
| 231 | #endif |
229 | #endif |
| 232 | eeprom_write_word_crc(EEDATA16.format, format, WITHOUT_CRC); |
230 | eeprom_write_word_crc(EEDATA16.format, format, WITHOUT_CRC); |
| 233 | EEDATA_UPDATE_CRC; |
231 | EEDATA_UPDATE_CRC; |
| 234 | - | ||
| 235 | printf("x\n"); |
- | |
| 236 | #endif |
232 | #endif |
| 237 | } |
233 | } |
| 238 | break; |
234 | break; |
| 239 | } |
235 | } |
| 240 | } |
236 | } |