MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / _serial_tx_flush

Function _serial_tx_flush

components/drivers/serial/dev_serial_v2.c:1265–1280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1263}
1264
1265static void _serial_tx_flush(struct rt_serial_device *serial)
1266{
1267 struct rt_serial_tx_fifo *tx_fifo;
1268 RT_ASSERT(serial != RT_NULL);
1269
1270 if (serial->config.tx_bufsz != 0)
1271 {
1272 tx_fifo = (struct rt_serial_tx_fifo *)serial->serial_tx;
1273 RT_ASSERT(tx_fifo != RT_NULL);
1274
1275 if (rt_atomic_load(&tx_fifo->activated))
1276 {
1277 rt_completion_wait(&tx_fifo->tx_cpt, RT_WAITING_FOREVER);
1278 }
1279 }
1280}
1281
1282static rt_err_t _serial_get_unread_bytes_count(struct rt_serial_device *serial, rt_ssize_t *unread_bytes)
1283{

Callers 2

_tc_flushFunction · 0.85
rt_serial_controlFunction · 0.85

Calls 1

rt_completion_waitFunction · 0.85

Tested by

no test coverage detected