diff options
Diffstat (limited to 'include/crc.h')
-rw-r--r-- | include/crc.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/crc.h b/include/crc.h new file mode 100644 index 0000000..89cde1f --- /dev/null +++ b/include/crc.h @@ -0,0 +1,21 @@ +/* + * (C) Copyright 2014 Leo C. <erbl259-lmu@yahoo.de> + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef CRC_H +#define CRC_H + +#ifdef __AVR__ +#include <util/crc16.h> +static inline +uint16_t crc16(uint16_t crc, uint8_t data) +{ + return _crc_ccitt_update(crc, data); +} +#else /* !__AVR__ */ + /* TODO */ +#endif /* __AVR__ */ + +#endif /* CRC_H */ |