Browse Source

fix when open samrt but using msh after run elf file the msh will down

zhujiale 3 tháng trước cách đây
mục cha
commit
9c164882e8
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      components/drivers/serial/serial_tty.c

+ 2 - 2
components/drivers/serial/serial_tty.c

@@ -131,7 +131,7 @@ static rt_err_t _serial_ty_bypass(struct rt_serial_device* serial, char ch,void
 rt_inline void _setup_serial(struct rt_serial_device* serial, lwp_tty_t tp,
                              struct serial_tty_context *softc)
 {
-    rt_bypass_lower_register(serial, "tty",RT_BYPASS_PROTECT_LEVEL_1, _serial_ty_bypass,(void *)tp);
+    rt_bypass_lower_register(serial, "tty", RT_BYPASS_PROTECT_LEVEL_1, _serial_ty_bypass, (void *)tp);
 }
 
 rt_inline void _restore_serial(struct rt_serial_device *serial, lwp_tty_t tp,
@@ -232,7 +232,7 @@ static void serial_tty_close(struct lwp_tty *tp)
 
     LOG_D("%s", __func__);
 
-    _restore_serial(serial, tp, softc);
+    rt_bypass_lower_unregister(serial, RT_BYPASS_PROTECT_LEVEL_1);
     rt_device_close(&serial->parent);
 }