Tested MS/TP using alternate CRC table method.

This commit is contained in:
skarg
2007-06-29 21:45:07 +00:00
parent 0543daa828
commit d0ea78178a
+3 -1
View File
@@ -132,6 +132,8 @@ static uint8_t calculate_header_CRC_table(
crc8 = CRC_Table[mstp_port->SourceAddress ^ crc8]; crc8 = CRC_Table[mstp_port->SourceAddress ^ crc8];
crc8 = CRC_Table[HI_BYTE(mstp_port->DataLength) ^ crc8]; crc8 = CRC_Table[HI_BYTE(mstp_port->DataLength) ^ crc8];
crc8 = CRC_Table[LO_BYTE(mstp_port->DataLength) ^ crc8]; crc8 = CRC_Table[LO_BYTE(mstp_port->DataLength) ^ crc8];
return (~crc8);
} }
static uint8_t calculate_header_CRC( static uint8_t calculate_header_CRC(
@@ -217,7 +219,7 @@ int main(void)
/* process the data portion of the frame */ /* process the data portion of the frame */
if (mstp_port->ReceivedValidFrame) { if (mstp_port->ReceivedValidFrame) {
mstp_port->ReceivedValidFrame = false; mstp_port->ReceivedValidFrame = false;
print_received_packet(mstp_port, false); print_received_packet(mstp_port, true);
} else if (mstp_port->ReceivedInvalidFrame) { } else if (mstp_port->ReceivedInvalidFrame) {
mstp_port->ReceivedInvalidFrame = false; mstp_port->ReceivedInvalidFrame = false;
fprintf(stderr, "ReceivedInvalidFrame\n"); fprintf(stderr, "ReceivedInvalidFrame\n");