Rev 179 | Rev 189 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 179 | Rev 180 | ||
---|---|---|---|
Line 128... | Line 128... | ||
128 | { |
128 | { |
129 | if(CheckDelay(SPI0_Timeout)) |
129 | if(CheckDelay(SPI0_Timeout)) |
130 | { |
130 | { |
131 | LED_RED_ON; |
131 | LED_RED_ON; |
132 | sprintf(ErrorMSG,"no FC communication "); |
132 | sprintf(ErrorMSG,"no FC communication "); |
133 | TIMER2_Deinit(); // reduce irq load |
- | |
134 | ErrorCode = 3; |
133 | ErrorCode = 3; |
135 | StopNavigation = 1; |
134 | StopNavigation = 1; |
136 | } |
135 | } |
137 | else if(CheckDelay(I2C1_Timeout)) |
136 | else if(CheckDelay(I2C1_Timeout)) |
138 | { |
137 | { |
Line 179... | Line 178... | ||
179 | ErrorCode = 7; |
178 | ErrorCode = 7; |
180 | } |
179 | } |
181 | else // no error occured |
180 | else // no error occured |
182 | { |
181 | { |
183 | sprintf(ErrorMSG,"No Error "); |
182 | sprintf(ErrorMSG,"No Error "); |
184 | if(ErrorCode == 3) |
- | |
185 | { |
- | |
186 | TIMER2_Init(); // enbable servo outputs |
- | |
187 | } |
- | |
188 | ErrorCode = 0; |
183 | ErrorCode = 0; |
189 | StopNavigation = 0; |
184 | StopNavigation = 0; |
190 | LED_RED_OFF; |
185 | LED_RED_OFF; |
191 | } |
186 | } |
192 | } |
187 | } |
Line 222... | Line 217... | ||
222 | Led_Init(); |
217 | Led_Init(); |
223 | // initialize the debug UART1 |
218 | // initialize the debug UART1 |
224 | UART1_Init(); |
219 | UART1_Init(); |
225 | UART1_PutString("\r\n---------------------------------------------"); |
220 | UART1_PutString("\r\n---------------------------------------------"); |
226 | // initialize timer 2 for servo outputs |
221 | // initialize timer 2 for servo outputs |
227 | TIMER2_Init(); |
222 | //TIMER2_Init(); |
228 | // initialize UART2 to FLIGHTCTRL |
223 | // initialize UART2 to FLIGHTCTRL |
229 | UART2_Init(); |
224 | UART2_Init(); |
230 | // initialize UART0 (to MKGPS or MK3MAG) |
225 | // initialize UART0 (to MKGPS or MK3MAG) |
231 | UART0_Init(); |
226 | UART0_Init(); |
232 | // initialize adc |
227 | // initialize adc |