CRC internal type more suitable for ARM.

This commit is contained in:
Jared Boone 2016-02-18 21:31:51 -08:00
parent 00fb25f143
commit 1e0d34c98b
4 changed files with 35 additions and 25 deletions

View file

@ -76,7 +76,7 @@ bool Packet::crc_ok() const {
}
bool Packet::crc_ok_scm() const {
CRC<uint16_t> ert_bch { 0x6f63 };
CRC<16> ert_bch { 0x6f63 };
size_t start_bit = 5;
ert_bch.process_byte(reader_.read(0, start_bit));
for(size_t i=start_bit; i<length(); i+=8) {
@ -86,7 +86,7 @@ bool Packet::crc_ok_scm() const {
}
bool Packet::crc_ok_idm() const {
CRC<uint16_t> ert_crc_ccitt { 0x1021, 0xffff, 0x1d0f };
CRC<16> ert_crc_ccitt { 0x1021, 0xffff, 0x1d0f };
for(size_t i=0; i<length(); i+=8) {
ert_crc_ccitt.process_byte(reader_.read(i, 8));
}