这是我写的一个一个uart1 向uart2传数据的程序为什么uart只收到16bytes的数据,很奇怪啊。
我做了一个大胆的猜想:uart1向uart2传输数据,传的很快,uart2来不及接收,rx FIFO又只能存16byte的数据,或者说FIFO满了,缺没有去清理,清理不是应该是硬件的事情吗
void UART2_IRQHandler(void)
{
uint8_t u8InChar = 0xFF;
uint32_t u32IntSts = UART2->INTSTS;
if(u32IntSts & UART_INTSTS_RDAINT_Msk)
{
/* Get all the input characters */
while(UART_IS_RX_READY(UART2))
{
/* Get the character from UART Buffer */
u8InChar = UART_READ(UART2);
printf("%c ", u8InChar);
}
}
void UART1_IRQHandler(void)
{
uint32_t u32IntSts = UART1->INTSTS;
if(u32IntSts & UART_INTSTS_THREINT_Msk)
{
while(num < 52)
{
while(UART_IS_TX_FULL(UART1));
//CLK_SysTickDelay(1000);
UART_WRITE(UART1, g_u8RecData[num]);
printf("%d,%c\t",num,g_u8RecData[num]);
num++;
}
//UART_Write(UART1,g_u8RecData,52);
UART_WRITE(UART1, '0');
g_bWait1 = FALSE;
}
} |