Home |
RTKernel-32 Programming Manual Function COMWaitSendBufferEmpty |
Function COMWaitSendBufferEmptyCOMWaitSendBufferEmpty waits for a send buffer to become empty: RTKBool COMWaitSendBufferEmpty(int Port, RTKDuration Timeout); ParametersPortThe port to wait on. TimeoutThe timeout in timer ticks for waiting until the send buffer becomes empty. return valueIf the function returns TRUE, the send buffer is empty. Otherwise, data may still be in the send buffer and the timeout has expired. This function waits until the send buffer of Port is empty, that is, all pending data has been sent to the UART. COMWaitSendBufferEmpty does not use polling; instead, the calling task is blocked until the send buffer is empty. Please note that the last byte may still be in the send shift register. To be sure all data has been sent out, check bit COM_TX_SHIFT_EMPTY in the Line Status register after a call to COMWaitSendBufferEmpty. Example:if (!COMWaitSendBufferEmpty(Port, 100)) printf("Send buffer not empty after 100 timer ticks!"); else while (!(COMLineStatus(Port) & COM_TX_SHIFT_EMPTY)) RTKDelay(0); Function COMSetModemStatusHook
|