TI的工程师们 请教下
UARTCharGet函数循环接收时第一次没有阻塞,
{
UART1_RX_data[0]=UARTCharGet(UART1_BASE);
SysCtlDelay(50000);
UARTCharPut(UART1_BASE,UART1_RX_data[0]);
SysCtlDelay(50000);
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
//*****************************************************************************
//
//! Waits for a character from the specified port.
//!
//! \param ui32Base is the base address of the UART port.
//!
//! This function gets a character from the receive FIFO for the specified
//! port. If there are no characters available, this function waits until a
//! character is received before returning.
//!
//! \return Returns the character read from the specified port, cast as a
//! \e int32_t.
//
//*****************************************************************************
int32_t
UARTCharGet(uint32_t ui32Base)
{
//
// Check the arguments.
//
ASSERT(_UARTBaseValid(ui32Base));
//
// Wait until a char is available.
//
while(HWREG(ui32Base + UART_O_FR) & UART_FR_RXFE)
{
}
//
// Now get the char.
//
return(HWREG(ui32Base + UART_O_DR));
}
注意标注红色部分,其可能没有获取字符,停留在此等待。
用了接收中断 但是每次上电只能进一次中断,后面发数据就进不去了
直接用串口可以了 ,后来改成用485和中断接收的模式 每次上点只能进一次中断
用了接收中断 但是每次上电只能进一次中断,后面发数据就进不去了