-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
d7f1195 Chrysler Checksum/counter (#450) 96e535e abstract crc function (#448) 1b49d3e Hyundai: add gas disengage and tests (#447) 598074c Volkswagen safety updates: Phase 2 (#445) b2ffaae Chrysler: disengage on gas press (#442) 2ebbe36 Subaru: disengage on gas press (#446) ccf75c4 Volkswagen safety updates: Phase 1 (#444) git-subtree-dir: panda git-subtree-split: d7f1195
- Loading branch information
Vehicle Researcher
committed
Feb 25, 2020
1 parent
6b8726e
commit f087c04
Showing
20 changed files
with
864 additions
and
383 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
uint8_t crc_checksum(uint8_t *dat, int len, const uint8_t poly) { | ||
uint8_t crc = 0xFF; | ||
int i, j; | ||
for (i = len - 1; i >= 0; i--) { | ||
crc ^= dat[i]; | ||
for (j = 0; j < 8; j++) { | ||
if ((crc & 0x80U) != 0U) { | ||
crc = (uint8_t)((crc << 1) ^ poly); | ||
} | ||
else { | ||
crc <<= 1; | ||
} | ||
} | ||
} | ||
return crc; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.