Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
crc.cpp
00001 #include "crc.h" 00002 00003 uint8_t crc8(const uint8_t *data, int len) 00004 { 00005 unsigned int crc = 0; 00006 00007 for (int j = len; j; j--, data++) 00008 { 00009 crc ^= (*data << 8); 00010 for (int i = 8; i; i--) 00011 { 00012 if (crc & 0x8000) 00013 { 00014 crc ^= (CRC8_GEN << 3); 00015 } 00016 crc <<= 1; 00017 } 00018 } 00019 00020 return (uint8_t)(crc >> 8); 00021 }
Generated on Tue Aug 9 2022 15:16:32 by
