Rev 146 | Rev 150 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 146 | Rev 149 | ||
---|---|---|---|
Line 133... | Line 133... | ||
133 | } |
133 | } |
134 | else if(CheckDelay(I2C1_Timeout)) |
134 | else if(CheckDelay(I2C1_Timeout)) |
135 | { |
135 | { |
136 | LED_RED_ON; |
136 | LED_RED_ON; |
137 | sprintf(ErrorMSG,"no MK3Mag communication "); |
137 | sprintf(ErrorMSG,"no MK3Mag communication "); |
- | 138 | //Reset I2CBus |
|
- | 139 | I2C1_Deinit(); |
|
- | 140 | I2C1_Init(); |
|
138 | ErrorCode = 4; |
141 | ErrorCode = 4; |
139 | StopNavigation = 1; |
142 | StopNavigation = 1; |
140 | } |
143 | } |
141 | else if(FC_Version.Compatible != FC_SPI_COMPATIBLE) |
144 | else if(FC_Version.Compatible != FC_SPI_COMPATIBLE) |
142 | { |
145 | { |
Line 227... | Line 230... | ||
227 | TimerCheckError = SetDelay(3000); |
230 | TimerCheckError = SetDelay(3000); |
228 | UART1_PutString("\r\n---------------------------------------------"); |
231 | UART1_PutString("\r\n---------------------------------------------"); |
229 | UART1_PutString("\n\r Version information:"); |
232 | UART1_PutString("\n\r Version information:"); |
Line 230... | Line 233... | ||
230 | 233 | ||
231 | GetNaviCtrlVersion(); |
234 | GetNaviCtrlVersion(); |
232 | 235 | ||
233 | SPI0_GetFlightCtrlVersion(); |
236 | SPI0_GetFlightCtrlVersion(); |
234 | if(FC_Version.Compatible != FC_SPI_COMPATIBLE) |
237 | if(FC_Version.Compatible != FC_SPI_COMPATIBLE) |
235 | { |
238 | { |
236 | UART1_PutString("\n\r Flight-Ctrl not compatible"); |
239 | UART1_PutString("\n\r Flight-Ctrl not compatible"); |
Line 259... | Line 262... | ||
259 | USB_ProcessRxData(); // process request |
262 | USB_ProcessRxData(); // process request |
260 | USB_TransmitTxData(); // send answer |
263 | USB_TransmitTxData(); // send answer |
Line 261... | Line 264... | ||
261 | 264 | ||
Line 262... | Line 265... | ||
262 | SPI0_UpdateBuffer(); // handle new SPI Data |
265 | SPI0_UpdateBuffer(); // handle new SPI Data |
Line 263... | Line 266... | ||
263 | 266 | ||
264 | //I2C1_UpdateCompass(); moved to Timer1 ISR |
267 | //I2C1_UpdateCompass(); moved to Timer1 ISR to avoid timing problems |
265 | 268 | ||
266 | // ---------------- Error Check Timing ---------------------------- |
269 | // ---------------- Error Check Timing ---------------------------- |