Serial port optimization

Reduce about 1/3 of the serial port overhead

Signed-off-by: AiYangSky <1732570904@qq.com>
This commit is contained in:
AiYangSky 2023-07-20 08:10:54 +00:00 committed by Gitee
parent 954551aa3f
commit 48f29e78f7
1 changed files with 1 additions and 2 deletions

View File

@ -39,9 +39,8 @@ public:
virtual bool inPutByte(IN uint8_t *byte)
{
if (ser->available() > 0)
if(ser->read(byte, 1))
{
ser->read(byte, 1);
return true;
}
return false;