1
0
mirror of git://projects.qi-hardware.com/antorcha.git synced 2024-11-01 09:24:05 +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:
Werner Almesberger 2012-06-20 16:46:27 -03:00
parent 6286aa9bbc
commit b7d80f1340

View File

@ -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: