ENEL400
/
Aloha
Aloha implementation of LoRa technology
Fork of SX1276PingPong by
Diff: crc.c
- Revision:
- 16:c3c6b13c3c42
- Parent:
- 15:f790f35839db
--- a/crc.c Tue May 31 09:52:21 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -#include "crc.h" - -uint8_t crc8(const uint8_t *data, int len) -{ - unsigned int crc = 0; - - for (int j = len; j; j--, data++) - { - crc ^= (*data << 8); - for (int i = 8; i; i--) - { - if (crc & 0x8000) - { - crc ^= (0x1070 << 3); - } - crc <<= 1; - } - } - - return (uint8_t)(crc >> 8); -} \ No newline at end of file