mirror of
git://projects.qi-hardware.com/antorcha.git
synced 2024-11-01 09:09:23 +02:00
fw/fw.c: simplify the use of the sequence number a little (untested)
Not sure if this even produces better code. It looks a bit cleaner, though.
This commit is contained in:
parent
6286aa9bbc
commit
b7d80f1340
4
fw/fw.c
4
fw/fw.c
@ -74,7 +74,7 @@ bool fw_packet(const uint8_t *buf, uint8_t len)
|
||||
/* Synchronize sequence numbers */
|
||||
|
||||
if (!buf[1]) {
|
||||
seq = buf[1];
|
||||
seq = 0;
|
||||
limit = buf[2];
|
||||
} else {
|
||||
if (buf[2] != limit)
|
||||
@ -87,7 +87,7 @@ bool fw_packet(const uint8_t *buf, uint8_t len)
|
||||
|
||||
/* Process the payload */
|
||||
|
||||
if (!fw_payload(buf[1], limit, buf+3))
|
||||
if (!fw_payload(seq, limit, buf+3))
|
||||
return 0;
|
||||
seq++;
|
||||
ack:
|
||||
|
Loading…
Reference in New Issue
Block a user