没意义的修改。
This commit is contained in:
parent
313e4a3648
commit
872963d9f8
@ -58,12 +58,11 @@ static uint8_t packet_read() {
|
|||||||
r = SerialDevice.read();
|
r = SerialDevice.read();
|
||||||
if (r == 0xE0) {
|
if (r == 0xE0) {
|
||||||
req.frame_len = 0xFF;
|
req.frame_len = 0xFF;
|
||||||
len = 0;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (req.frame_len == 0xFF) {
|
if (req.frame_len == 0xFF) {
|
||||||
req.frame_len = r;
|
req.frame_len = r;
|
||||||
len = 1;
|
len = 0;
|
||||||
checksum = r;
|
checksum = r;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -75,10 +74,10 @@ static uint8_t packet_read() {
|
|||||||
r++;
|
r++;
|
||||||
escape = false;
|
escape = false;
|
||||||
}
|
}
|
||||||
|
req.bytes[++len] = r;
|
||||||
if (len == req.frame_len && checksum == r) {
|
if (len == req.frame_len && checksum == r) {
|
||||||
return req.cmd;
|
return req.cmd;
|
||||||
}
|
}
|
||||||
req.bytes[len++] = r;
|
|
||||||
checksum += r;
|
checksum += r;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user