1、zstack1.2.2协议栈
调用HAL_UARTWRITE函数,串口并不是马上发送出来,目前需要调用此函数串口马上发送出来,有没有什么办法
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.
1、zstack1.2.2协议栈
调用HAL_UARTWRITE函数,串口并不是马上发送出来,目前需要调用此函数串口马上发送出来,有没有什么办法
不清楚你的“不是马上发送出来”是延迟了多久,HAL_UARTWRITE里需要调用其他函数进行数据发送操作的:
uint16 HalUARTWrite(uint8 port, uint8 *buf, uint16 len)
{
(void)port;
(void)buf;
(void)len;
#if (HAL_UART_DMA == 1)
if (port == HAL_UART_PORT_0) return HalUARTWriteDMA(buf, len);
#endif
#if (HAL_UART_DMA == 2)
if (port == HAL_UART_PORT_1) return HalUARTWriteDMA(buf, len);
#endif
#if (HAL_UART_ISR == 1)
if (port == HAL_UART_PORT_0) return HalUARTWriteISR(buf, len);
#endif
#if (HAL_UART_ISR == 2)
if (port == HAL_UART_PORT_1) return HalUARTWriteISR(buf, len);
#endif
#if HAL_UART_USB
HalUARTTx(buf, len);
return len;
#else
return 0;
#endif
}