Skip to content

Commit e604e34

Browse files
committed
fix: Fettling - More mocking exploration
1 parent 7266e7c commit e604e34

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.arduino_ci/crc16.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
#ifdef __cplusplus
22+
}
23+
#endif
24+
25+
#endif

0 commit comments

Comments
 (0)