Rev 465 | Rev 470 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 465 | Rev 469 | ||
---|---|---|---|
Line 144... | Line 144... | ||
144 | { |
144 | { |
145 | static s32 no_error_delay = 0; |
145 | static s32 no_error_delay = 0; |
146 | s32 newErrorCode = 0; |
146 | s32 newErrorCode = 0; |
147 | UART_VersionInfo.HardwareError[0] = 0; |
147 | UART_VersionInfo.HardwareError[0] = 0; |
Line -... | Line 148... | ||
- | 148 | ||
148 | 149 | //ToDo |
|
149 | if(CheckDelay(I2C1_Timeout) || (Compass_Heading < 0)) DebugOut.StatusRed |= AMPEL_COMPASS; |
150 | if(CheckDelay(I2C1_Timeout) || (Compass_Heading < 0)) DebugOut.StatusRed |= AMPEL_COMPASS; |
Line 150... | Line 151... | ||
150 | else DebugOut.StatusRed &= ~AMPEL_COMPASS; // MK3Mag green status |
151 | else DebugOut.StatusRed &= ~AMPEL_COMPASS; // MK3Mag green status |
151 | 152 | ||
Line 171... | Line 172... | ||
171 | StopNavigation = 1; |
172 | StopNavigation = 1; |
172 | DebugOut.StatusGreen &= ~AMPEL_FC; // status of FC Present |
173 | DebugOut.StatusGreen &= ~AMPEL_FC; // status of FC Present |
173 | DebugOut.StatusGreen &= ~AMPEL_BL; // status of BL Present |
174 | DebugOut.StatusGreen &= ~AMPEL_BL; // status of BL Present |
174 | UART_VersionInfo.HardwareError[0] |= NC_ERROR0_SPI_RX; |
175 | UART_VersionInfo.HardwareError[0] |= NC_ERROR0_SPI_RX; |
175 | } |
176 | } |
- | 177 | //ToDo |
|
176 | else if(CheckDelay(I2C1_Timeout)) |
178 | else if(CheckDelay(I2C1_Timeout)) |
177 | { |
179 | { |
178 | LED_RED_ON; |
180 | LED_RED_ON; |
179 | sprintf(ErrorMSG,"no compass communica"); |
181 | sprintf(ErrorMSG,"no compass communica"); |
180 | //Reset I2CBus |
182 | //Reset I2CBus |
Line 492... | Line 494... | ||
492 | Led_Init(); |
494 | Led_Init(); |
493 | // initialize the debug UART1 |
495 | // initialize the debug UART1 |
494 | UART1_Init(); |
496 | UART1_Init(); |
495 | UART1_PutString("\r\n---------------------------------------------"); |
497 | UART1_PutString("\r\n---------------------------------------------"); |
496 | // initialize usb |
498 | // initialize usb |
497 | USB_ConfigInit(); |
499 | // to do |
- | 500 | //USB_ConfigInit(); // disable because of unexpected side effects with I2C0 |
|
498 | // initialize timer 2 for servo outputs |
501 | // initialize timer 2 for servo outputs |
499 | //TIMER2_Init(); |
502 | //TIMER2_Init(); |
500 | // initialize UART2 to FLIGHTCTRL |
503 | // initialize UART2 to FLIGHTCTRL |
501 | UART2_Init(); |
504 | UART2_Init(); |
502 | // initialize UART0 (to MKGPS or MK3MAG) |
505 | // initialize UART0 (to MKGPS or MK3MAG) |
503 | UART0_Init(); |
506 | UART0_Init(); |
504 | // initialize adc |
507 | // initialize adc |
505 | Analog_Init(); |
508 | Analog_Init(); |
506 | // initialize SPI0 to FC |
509 | // initialize SPI0 to FC |
507 | SPI0_Init(); |
510 | SPI0_Init(); |
508 | // initialize i2c bus (needs Timer 1) |
511 | // initialize i2c busses (needs Timer 1) |
509 | I2C0_Init(); |
512 | I2C0_Init(); |
510 | I2C1_Init(); |
513 | I2C1_Init(); |
Line 511... | Line 514... | ||
511 | 514 | ||
512 | // initialize fat16 partition on sd card (needs Timer 1) |
515 | // initialize fat16 partition on sd card (needs Timer 1) |