We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 11d45f9 commit ece7b4fCopy full SHA for ece7b4f
1 file changed
components/drivers/serial/dev_serial_v2.c
@@ -89,9 +89,6 @@ static int serial_fops_open(struct dfs_file *fd)
89
break;
90
}
91
92
- if ((fd->flags & O_ACCMODE) != O_WRONLY)
93
- rt_device_set_rx_indicate(device, serial_fops_rx_ind);
94
-
95
flags |= RT_SERIAL_RX_BLOCKING | RT_SERIAL_TX_BLOCKING;
96
97
/* preserve RT_DEVICE_FLAG_STREAM if it was set before close */
@@ -105,6 +102,9 @@ static int serial_fops_open(struct dfs_file *fd)
105
102
106
103
if (ret == RT_EOK)
107
104
{
+ if ((fd->flags & O_ACCMODE) != O_WRONLY)
+ rt_device_set_rx_indicate(device, serial_fops_rx_ind);
+
108
serial = (struct rt_serial_device *)device;
109
serial->is_posix_mode = RT_TRUE;
110
0 commit comments