File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
components/drivers/serial Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -882,6 +882,7 @@ static int _get_baudrate(speed_t speed)
882882
883883static void _tc_flush (struct rt_serial_device * serial , int queue )
884884{
885+ rt_base_t level ;
885886 int ch = -1 ;
886887 struct rt_serial_rx_fifo * rx_fifo = RT_NULL ;
887888 struct rt_device * device = RT_NULL ;
@@ -901,10 +902,12 @@ static void _tc_flush(struct rt_serial_device *serial, int queue)
901902 if ((device -> open_flag & RT_DEVICE_FLAG_INT_RX ) || (device -> open_flag & RT_DEVICE_FLAG_DMA_RX ))
902903 {
903904 RT_ASSERT (RT_NULL != rx_fifo );
905+ level = rt_hw_interrupt_disable ();
904906 rt_memset (rx_fifo -> buffer , 0 , serial -> config .bufsz );
905907 rx_fifo -> put_index = 0 ;
906908 rx_fifo -> get_index = 0 ;
907909 rx_fifo -> is_full = RT_FALSE ;
910+ rt_hw_interrupt_enable (level );
908911 }
909912 else
910913 {
You can’t perform that action at this time.
0 commit comments