intercom: don't store start byte twice.

This commit is contained in:
Markus Amsler 2011-02-13 21:32:32 +01:00 committed by Michael Moon
parent e6a137d5f1
commit a3b1529607
2 changed files with 4 additions and 6 deletions

View File

@ -168,9 +168,8 @@ ISR(USART_RX_vect)
packet_pointer = 1; packet_pointer = 1;
intercom_flags |= FLAG_RX_IN_PROGRESS; intercom_flags |= FLAG_RX_IN_PROGRESS;
} }
else if (packet_pointer > 0) {
// we're receiving a packet // we're receiving a packet
if (packet_pointer > 0) {
// calculate CRC (except CRC character!) // calculate CRC (except CRC character!)
if (packet_pointer < (sizeof(intercom_packet_t) - 1)) if (packet_pointer < (sizeof(intercom_packet_t) - 1))
rxcrc ^= c; rxcrc ^= c;

View File

@ -168,9 +168,8 @@ ISR(USART_RX_vect)
packet_pointer = 1; packet_pointer = 1;
intercom_flags |= FLAG_RX_IN_PROGRESS; intercom_flags |= FLAG_RX_IN_PROGRESS;
} }
else if (packet_pointer > 0) {
// we're receiving a packet // we're receiving a packet
if (packet_pointer > 0) {
// calculate CRC (except CRC character!) // calculate CRC (except CRC character!)
if (packet_pointer < (sizeof(intercom_packet_t) - 1)) if (packet_pointer < (sizeof(intercom_packet_t) - 1))
rxcrc ^= c; rxcrc ^= c;