Rev 671 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 671 | Rev 675 | ||
---|---|---|---|
Line 138... | Line 138... | ||
138 | u32 UART1_FollowMe_Timer = 0; |
138 | u32 UART1_FollowMe_Timer = 0; |
139 | Point_t FollowMe; |
139 | Point_t FollowMe; |
140 | #endif |
140 | #endif |
Line 141... | Line 141... | ||
141 | 141 | ||
142 | // the primary rx fifo |
142 | // the primary rx fifo |
143 | #define UART1_RX_FIFO_LEN 1024 |
143 | #define UART1_RX_FIFO_LEN 1500 |
144 | u8 UART1_rxfifobuffer[UART1_RX_FIFO_LEN]; |
144 | u8 UART1_rxfifobuffer[UART1_RX_FIFO_LEN]; |
Line 145... | Line 145... | ||
145 | fifo_t UART1_rx_fifo; |
145 | fifo_t UART1_rx_fifo; |
146 | 146 | ||
147 | // the rx buffer |
147 | // the rx buffer |
148 | #define UART1_RX_BUFFER_LEN 1024 |
148 | #define UART1_RX_BUFFER_LEN 1500 |
Line 149... | Line 149... | ||
149 | u8 UART1_rbuffer[UART1_RX_BUFFER_LEN]; |
149 | u8 UART1_rbuffer[UART1_RX_BUFFER_LEN]; |
150 | Buffer_t UART1_rx_buffer; |
150 | Buffer_t UART1_rx_buffer; |
Line 269... | Line 269... | ||
269 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3; |
269 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3; |
270 | GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull; |
270 | GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull; |
271 | GPIO_InitStructure.GPIO_Alternate = GPIO_OutputAlt2; // UART1_TX |
271 | GPIO_InitStructure.GPIO_Alternate = GPIO_OutputAlt2; // UART1_TX |
272 | GPIO_Init(GPIO3, &GPIO_InitStructure); |
272 | GPIO_Init(GPIO3, &GPIO_InitStructure); |
Line -... | Line 273... | ||
- | 273 | ||
- | 274 | // Control of PORT3.7 (FC-UART) |
|
- | 275 | GPIO_StructInit(&GPIO_InitStructure); |
|
- | 276 | GPIO_InitStructure.GPIO_Direction = GPIO_PinOutput; |
|
- | 277 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7; |
|
- | 278 | GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull; |
|
- | 279 | GPIO_InitStructure.GPIO_Alternate = GPIO_OutputAlt1; |
|
- | 280 | GPIO_Init(GPIO3, &GPIO_InitStructure); |
|
- | 281 | DISABLE_FC_UART; |
|
273 | 282 | ||
274 | /* UART1 configured as follow: |
283 | /* UART1 configured as follow: |
275 | - Word Length = 8 Bits |
284 | - Word Length = 8 Bits |
276 | - One Stop Bit |
285 | - One Stop Bit |
277 | - No parity |
286 | - No parity |
Line 367... | Line 376... | ||
367 | UART0_Connect_to_MKGPS(UART0_BAUD_RATE); |
376 | UART0_Connect_to_MKGPS(UART0_BAUD_RATE); |
368 | TIMER2_Init(); // enbable servo outputs |
377 | TIMER2_Init(); // enbable servo outputs |
369 | fifo_purge(&UART1_rx_fifo); // flush the whole fifo init buffer |
378 | fifo_purge(&UART1_rx_fifo); // flush the whole fifo init buffer |
370 | } |
379 | } |
371 | DebugUART = UART1; |
380 | DebugUART = UART1; |
- | 381 | DISABLE_FC_UART; |
|
372 | } |
382 | } |
373 | abortState = 0; |
383 | abortState = 0; |
374 | break; |
384 | break; |
375 | } // end switch abort state |
385 | } // end switch abort state |
376 | // if the Debug uart is not UART1, redirect input to the Debug UART |
386 | // if the Debug uart is not UART1, redirect input to the Debug UART |
Line 520... | Line 530... | ||
520 | break; |
530 | break; |
521 | case 'u': // redirect debug uart |
531 | case 'u': // redirect debug uart |
522 | switch(SerialMsg.pData[0]) |
532 | switch(SerialMsg.pData[0]) |
523 | { |
533 | { |
524 | case UART_FLIGHTCTRL: |
534 | case UART_FLIGHTCTRL: |
- | 535 | ENABLE_FC_UART; |
|
525 | UART2_Init(); // initialize UART2 to FC pins |
536 | UART2_Init(); // initialize UART2 to FC pins |
526 | fifo_purge(&UART1_rx_fifo); |
537 | fifo_purge(&UART1_rx_fifo); |
527 | TIMER2_Deinit(); // reduce irq load |
538 | TIMER2_Deinit(); // reduce irq load |
528 | DebugUART = UART2; |
539 | DebugUART = UART2; |
529 | break; |
540 | break; |