Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion components/drivers/serial/dev_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,17 @@ static int serial_fops_close(struct dfs_file *fd)

device = (rt_device_t)fd->vnode->data;

rt_device_set_rx_indicate(device, RT_NULL);
/* close this file descriptor, but only drop the rx indication callback when
* the device is really released. The callback wakes readers (see
* serial_fops_rx_ind), so clearing it while another user still holds the
* device would make that user stop receiving input. */
rt_device_close(device);

if (device->ref_count == 0)
{
rt_device_set_rx_indicate(device, RT_NULL);
}

return 0;
}

Expand Down
Loading