9 #if (defined _MSC_VER) && (_MSC_VER < 1600)
10 #error "The C-MAVLink implementation requires Visual Studio 2010 or greater"
21 #define X25_INIT_CRC 0xffff
22 #define X25_VALIDATE_CRC 0xf0b8
24 #ifndef HAVE_CRC_ACCUMULATE
34 static inline void crc_accumulate(uint8_t
data, uint16_t *crcAccum)
39 tmp = data ^ (uint8_t)(*crcAccum &0xff);
41 *crcAccum = (*crcAccum>>8) ^ (tmp<<8) ^ (tmp <<3) ^ (tmp>>4);
51 static inline void crc_init(uint16_t* crcAccum)
64 static inline uint16_t crc_calculate(
const uint8_t* pBuffer, uint16_t length)
69 crc_accumulate(*pBuffer++, &crcTmp);
84 static inline void crc_accumulate_buffer(uint16_t *crcAccum,
const char *pBuffer, uint16_t length)
86 const uint8_t *p = (
const uint8_t *)pBuffer;
88 crc_accumulate(*p++, crcAccum);
#define X25_INIT_CRC
Definition: checksum.h:21
uint16_t data
Definition: config.c:91