We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7266e7c commit e604e34Copy full SHA for e604e34
.arduino_ci/crc16.h
@@ -0,0 +1,25 @@
1
+#ifndef CRC16_H
2
+#define CRC16_H
3
+
4
+#ifdef __cplusplus
5
+extern "C" {
6
+#endif
7
8
+// Pure C implementation to replace the ASM version
9
+static inline uint16_t _crc16_update(uint16_t crc, uint8_t data) {
10
+ unsigned int i;
11
+ crc ^= data;
12
+ for (i = 0; i < 8; ++i) {
13
+ if (crc & 1)
14
+ crc = (crc >> 1) ^ 0xA001;
15
+ else
16
+ crc = (crc >> 1);
17
+ }
18
+ return crc;
19
+}
20
21
22
23
24
25
0 commit comments