Skip to content

Commit 691c42c

Browse files
committed
fix: Fettling - attempting to mock the avr headers
1 parent 0ac8438 commit 691c42c

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

.arduino-ci.cpp

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
#define ARDUINO_CI 1
22

3-
// Mock implementation of CRC16 for testing
4-
extern "C" uint16_t _crc16_update(uint16_t crc, uint8_t data) {
3+
// Mock OneWire GPIO functions
4+
uint8_t digitalPinToBitMask(uint8_t pin) { return 1 << (pin % 8); }
5+
void* digitalPinToPort(uint8_t pin) { static uint8_t dummy; return &dummy; }
6+
void* portModeRegister(void* port) { return port; }
7+
8+
// Mock CRC16 implementation
9+
uint16_t _crc16_update(uint16_t crc, uint8_t data) {
510
uint8_t i;
611
crc ^= data;
712
for (i = 0; i < 8; ++i) {
@@ -11,4 +16,4 @@ extern "C" uint16_t _crc16_update(uint16_t crc, uint8_t data) {
1116
crc = (crc >> 1);
1217
}
1318
return crc;
14-
}
19+
}

.arduino-ci.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ unittest:
1111
libraries:
1212
- "OneWire"
1313
mocks:
14-
- crc16.h
14+
- crc16.h
15+
- OneWire_direct_gpio.h
16+
- pins_arduino.h

0 commit comments

Comments
 (0)