1
0
mirror of synced 2024-11-23 23:50:56 +01:00

没意义的修改。

This commit is contained in:
Sucareto 2021-12-07 19:41:50 +08:00 committed by GitHub
parent 313e4a3648
commit 872963d9f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,12 +58,11 @@ static uint8_t packet_read() {
r = SerialDevice.read();
if (r == 0xE0) {
req.frame_len = 0xFF;
len = 0;
continue;
}
if (req.frame_len == 0xFF) {
req.frame_len = r;
len = 1;
len = 0;
checksum = r;
continue;
}
@ -75,10 +74,10 @@ static uint8_t packet_read() {
r++;
escape = false;
}
req.bytes[++len] = r;
if (len == req.frame_len && checksum == r) {
return req.cmd;
}
req.bytes[len++] = r;
checksum += r;
}
return 0;