File tree Expand file tree Collapse file tree 1 file changed +20
-10
lines changed
Expand file tree Collapse file tree 1 file changed +20
-10
lines changed Original file line number Diff line number Diff line change @@ -28,16 +28,26 @@ jobs:
2828 - name : Install OneWire library
2929 run : |
3030 arduino-cli lib install OneWire
31- # Debug: Show initial contents
32- echo "Initial OneWire util directory contents:"
33- ls -la /home/runner/Arduino/libraries/OneWire/util/
34- # Only create symlink for crc16.h if it doesn't exist
35- if [ ! -f "/home/runner/Arduino/libraries/OneWire/util/crc16.h" ]; then
36- sudo ln -s /usr/lib/avr/include/util/crc16.h /home/runner/Arduino/libraries/OneWire/util/
37- fi
38- # Debug: Show final contents
39- echo "Final OneWire util directory contents:"
40- ls -la /home/runner/Arduino/libraries/OneWire/util/
31+ # Replace the CRC implementation directly in the OneWire library
32+ cat > /home/runner/Arduino/libraries/OneWire/util/crc16.h << 'EOF'
33+ #ifndef CRC16_H
34+ #define CRC16_H
35+ #include <stdint.h>
36+
37+ static inline uint16_t _crc16_update(uint16_t crc, uint8_t a)
38+ {
39+ crc ^= a;
40+ for (uint8_t i = 0; i < 8; ++i) {
41+ if (crc & 1)
42+ crc = (crc >> 1) ^ 0xA001;
43+ else
44+ crc = (crc >> 1);
45+ }
46+ return crc;
47+ }
48+
49+ #endif
50+ EOF
4151 - name : Set up Ruby
4252 uses : ruby/setup-ruby@v1
4353 with :
You can’t perform that action at this time.
0 commit comments