when flag is RT_DEVICE_FLAG_STREAM, paser '\n' break!
This commit is contained in:
parent
091089f16d
commit
7a1f0e0f67
|
@ -221,8 +221,11 @@ rt_inline int _serial_poll_rx(struct rt_serial_device *serial, rt_uint8_t *data,
|
|||
*data = ch;
|
||||
data ++; length --;
|
||||
|
||||
if(serial->parent.open_flag & RT_DEVICE_FLAG_STREAM)
|
||||
{
|
||||
if (ch == '\n') break;
|
||||
}
|
||||
}
|
||||
|
||||
return size - length;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue