mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-25 07:10:43 -04:00
CRC internal type more suitable for ARM.
This commit is contained in:
parent
00fb25f143
commit
1e0d34c98b
4 changed files with 35 additions and 25 deletions
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue