Rev 2116 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2116 | Rev 2132 | ||
---|---|---|---|
Line 142... | Line 142... | ||
142 | IMUConfig_writeToEEprom(); |
142 | IMUConfig_writeToEEprom(); |
143 | } |
143 | } |
144 | } |
144 | } |
Line 145... | Line 145... | ||
145 | 145 | ||
146 | /***************************************************/ |
146 | /***************************************************/ |
147 | /* ChannelMap */ |
147 | /* ChannelMap and R/C trim */ |
148 | /***************************************************/ |
148 | /***************************************************/ |
149 | void channelMap_writeToEEProm(void) { |
149 | void channelMap_writeToEEProm(void) { |
150 | writeChecksummedBlock(CHANNELMAP_REVISION, (uint8_t*)&channelMap, EEPROM_ADR_CHANNELMAP, sizeof(ChannelMap_t)); |
150 | writeChecksummedBlock(CHANNELMAP_REVISION, (uint8_t*)&channelMap, EEPROM_ADR_CHANNELMAP, sizeof(ChannelMap_t)); |
Line 151... | Line 151... | ||
151 | } |
151 | } |
152 | 152 | ||
153 | void channelMap_readOrDefault(void) { |
153 | void channelMap_readOrDefault(void) { |
154 | if (readChecksummedBlock(CHANNELMAP_REVISION, (uint8_t*)&channelMap, EEPROM_ADR_CHANNELMAP, sizeof(ChannelMap_t))) { |
154 | if (readChecksummedBlock(CHANNELMAP_REVISION, (uint8_t*)&channelMap, EEPROM_ADR_CHANNELMAP, sizeof(ChannelMap_t))) { |
155 | printf("\n\rwriting default channel map"); |
155 | printf("\n\rwriting default channel map"); |
- | 156 | channelMap_default(); |
|
- | 157 | channelMap_writeToEEProm(); |
|
- | 158 | } |
|
- | 159 | } |
|
- | 160 | ||
- | 161 | void rcTrim_writeToEEProm(void) { |
|
- | 162 | writeChecksummedBlock(0, (uint8_t*)&rcTrim, EEPROM_ADR_RCTRIM, sizeof(RCTrim_t)); |
|
- | 163 | } |
|
- | 164 | ||
- | 165 | void rcTrim_readOrDefault(void) { |
|
156 | channelMap_default(); |
166 | if (readChecksummedBlock(0, (uint8_t*)&rcTrim, EEPROM_ADR_RCTRIM, sizeof(RCTrim_t))) { |
- | 167 | printf("\n\rwriting zero RC trim"); |
|
157 | channelMap_writeToEEProm(); |
168 | RC_setZeroTrim(); |
158 | wdt_enable(WDTO_500MS); |
169 | rcTrim_writeToEEProm(); |
Line 159... | Line 170... | ||
159 | } |
170 | } |
160 | } |
171 | } |