mirror of
https://github.com/apache/nuttx.git
synced 2026-05-29 04:19:37 +08:00
com/can: attempt to release invalid resources when sender is full
Attempt to release invalid resources when sender is full. Signed-off-by: gaohedong <gaohedong@xiaomi.com>
This commit is contained in:
@@ -647,6 +647,21 @@ static ssize_t can_write(FAR struct file *filep, FAR const char *buffer,
|
||||
|
||||
while (TX_FULL(sender))
|
||||
{
|
||||
/* The transmit sender is full. In order to resolve the Lower half
|
||||
* interrupt exception, attempt to release invalid unconfirm
|
||||
* messages and trigger can_xmit.
|
||||
*/
|
||||
|
||||
if (dev_txempty(dev))
|
||||
{
|
||||
can_send_done(sender);
|
||||
|
||||
if (!TX_FULL(sender))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* The transmit sender is full -- non-blocking mode selected? */
|
||||
|
||||
if ((filep->f_oflags & O_NONBLOCK) != 0)
|
||||
|
||||
Reference in New Issue
Block a user