!10 优化串口开销

Merge pull request !10 from AiYangSky/Serial-port-optimization
This commit is contained in:
jario-jin 2023-07-20 09:47:25 +00:00 committed by Gitee
commit c0b7ac6ca7
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;