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 ae3509f836
commit 14d15d612e
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
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;