Rev 486 | Rev 489 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 486 | Rev 487 | ||
---|---|---|---|
Line 248... | Line 248... | ||
248 | UART_InitStructure.UART_StopBits = UART_StopBits_1; |
248 | UART_InitStructure.UART_StopBits = UART_StopBits_1; |
249 | UART_InitStructure.UART_Parity = UART_Parity_No ; |
249 | UART_InitStructure.UART_Parity = UART_Parity_No ; |
250 | UART_InitStructure.UART_BaudRate = UART1_BAUD_RATE; |
250 | UART_InitStructure.UART_BaudRate = UART1_BAUD_RATE; |
251 | UART_InitStructure.UART_HardwareFlowControl = UART_HardwareFlowControl_None; |
251 | UART_InitStructure.UART_HardwareFlowControl = UART_HardwareFlowControl_None; |
252 | UART_InitStructure.UART_Mode = UART_Mode_Tx_Rx; |
252 | UART_InitStructure.UART_Mode = UART_Mode_Tx_Rx; |
253 | // UART_InitStructure.UART_FIFO = UART_FIFO_Enable; |
253 | // AVOID_I2C_COLLISION UART_InitStructure.UART_FIFO = UART_FIFO_Disable; |
- | 254 | // AVOID_I2C_COLLISION UART_InitStructure.UART_TxFIFOLevel = UART_FIFOLevel_1_8; // FIFO size 16 bytes, FIFO level 2 bytes |
|
254 | UART_InitStructure.UART_FIFO = UART_FIFO_Disable; |
255 | UART_InitStructure.UART_FIFO = UART_FIFO_Enable; |
255 | // UART_InitStructure.UART_TxFIFOLevel = UART_FIFOLevel_1_2; |
256 | UART_InitStructure.UART_TxFIFOLevel = UART_FIFOLevel_1_2; |
256 | UART_InitStructure.UART_TxFIFOLevel = UART_FIFOLevel_1_8; // FIFO size 16 bytes, FIFO level 2 bytes |
- | |
257 | UART_InitStructure.UART_RxFIFOLevel = UART_FIFOLevel_1_2; // FIFO size 16 bytes, FIFO level 8 bytes |
257 | UART_InitStructure.UART_RxFIFOLevel = UART_FIFOLevel_1_2; // FIFO size 16 bytes, FIFO level 8 bytes |
Line 258... | Line 258... | ||
258 | 258 | ||
259 | UART_DeInit(UART1); // reset uart 1 to default |
259 | UART_DeInit(UART1); // reset uart 1 to default |
260 | UART_Init(UART1, &UART_InitStructure); // initialize uart 1 |
260 | UART_Init(UART1, &UART_InitStructure); // initialize uart 1 |
Line 653... | Line 653... | ||
653 | /**************************************************************/ |
653 | /**************************************************************/ |
654 | void UART1_Transmit(void) |
654 | void UART1_Transmit(void) |
655 | { |
655 | { |
656 | u8 tmp_tx; |
656 | u8 tmp_tx; |
657 | if(DebugUART != UART1) return; |
657 | if(DebugUART != UART1) return; |
658 | if(I2C0_State != I2C_STATE_IDLE) return; |
658 | // AVOID_I2C_COLLISION if(I2C0_State != I2C_STATE_IDLE) return; |
659 | // if something has to be send and the txd fifo is not full |
659 | // if something has to be send and the txd fifo is not full |
660 | if(UART1_tx_buffer.Locked == TRUE) |
660 | if(UART1_tx_buffer.Locked == TRUE) |
661 | { |
661 | { |
662 | // while there is some space in the tx fifo |
662 | // while there is some space in the tx fifo |
663 | while(UART_GetFlagStatus(UART1, UART_FLAG_TxFIFOFull) != SET) |
663 | while(UART_GetFlagStatus(UART1, UART_FLAG_TxFIFOFull) != SET) |