소스 검색

Use open_flag for serial device.

bernard 10 년 전
부모
커밋
a6251a439e
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      components/drivers/serial/serial.c

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

@@ -26,6 +26,7 @@
  * 2013-02-20     bernard      use RT_SERIAL_RB_BUFSZ to define
  * 2013-02-20     bernard      use RT_SERIAL_RB_BUFSZ to define
  *                             the size of ring buffer.
  *                             the size of ring buffer.
  * 2014-07-10     bernard      rewrite serial framework
  * 2014-07-10     bernard      rewrite serial framework
+ * 2014-12-31     bernard      use open_flag for poll_tx stream mode.
  */
  */
 
 
 #include <rthw.h>
 #include <rthw.h>
@@ -67,7 +68,7 @@ rt_inline int _serial_poll_tx(struct rt_serial_device *serial, const rt_uint8_t
          * to be polite with serial console add a line feed
          * to be polite with serial console add a line feed
          * to the carriage return character
          * to the carriage return character
          */
          */
-        if (*data == '\n' && (serial->parent.flag & RT_DEVICE_FLAG_STREAM))
+        if (*data == '\n' && (serial->parent.open_flag & RT_DEVICE_FLAG_STREAM))
         {
         {
             serial->ops->putc(serial, '\r');
             serial->ops->putc(serial, '\r');
         }
         }