Rev 360 | Rev 378 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 360 | Rev 362 | ||
---|---|---|---|
Line 602... | Line 602... | ||
602 | /*****************************************************/ |
602 | /*****************************************************/ |
603 | /* Send a character */ |
603 | /* Send a character */ |
604 | /*****************************************************/ |
604 | /*****************************************************/ |
605 | s16 UART1_Putchar(char c) |
605 | s16 UART1_Putchar(char c) |
606 | { |
606 | { |
- | 607 | u32 timeout = 10000; |
|
607 | if (c == '\n') UART1_Putchar('\r'); |
608 | if (c == '\n') UART1_Putchar('\r'); |
608 | // wait until txd fifo is not full |
609 | // wait until txd fifo is not full |
609 | while (UART_GetFlagStatus(UART1, UART_FLAG_TxFIFOFull) != RESET); |
610 | while(UART_GetFlagStatus(UART1, UART_FLAG_TxFIFOFull) != RESET) if(--timeout == 0) return(0); |
610 | // transmit byte |
611 | // transmit byte |
611 | UART_SendData(UART1, c); |
612 | UART_SendData(UART1, c); |
612 | #ifdef FOLLOW_ME |
613 | #ifdef FOLLOW_ME |
613 | if(TransmitAlsoToFC) UART_SendData(UART2, c); |
614 | if(TransmitAlsoToFC) UART_SendData(UART2, c); |
614 | #endif |
615 | #endif |