你在第二个UART_DRV_ReceiveDataBlocking那打断点,如果不接受,就不能进入下一条?
这样你直接跑官方的hello world,然后把
//#define USE_STDIO_FUNCTIONS
这句屏蔽掉,把
main 中最后的while(1)改成这样:
while(1)
{
/********************************************
* Main routine that simply echoes received
* characters forever
*********************************************/
i++;
/* First, get character. */
while(1)
{
UART_DRV_ReceiveDataBlocking(BOARD_DEBUG_UART_INSTANCE, receiveBuff, 1,
200);//00000001U OSA_WAIT_FOREVER
/* Now, stuff the buffer for the TX side and send the character*/
sourceBuff[0] = receiveBuff[0];
if(sourceBuff[0] =='a')
{
sourceBuff[0] = 0;
break;
}
/* Now echo the received character */
UART_DRV_SendDataBlocking(BOARD_DEBUG_UART_INSTANCE, sourceBuff, 1,
200);
}
}
你会发现,就算不发送,也会一直在第二个while(1)里面循环,可以进入sourceBuff[0] = receiveBuff[0];
而不是直接在UART_DRV_ReceiveDataBlocking那等。
你用官方代码试试。
|