arduino-sps
arduino-sps copied to clipboard
Fix compilation on MegaAvr architectures
MegaAvr architectures (https://github.com/arduino/ArduinoCore-megaavr) set the __AVR__ define, but use different register names than the ATMega328P, and as such the internal I2C library fails to compile. Additionally, the platform appears to have done away with the 32 byte I2C limit, and as such the workaround is not necessary.
I've done a quick fix here to address issue #36 in the short term: https://github.com/Sensirion/arduino-sps/tree/winkj-temp-fix-atmega4809
A proper fix should change the code to look at the various AVR board defines instead - e.g. __AVR_ATmega168__, __AVR_ATmega328P__, __AVR_ATmega2560__, __AVR_ATmega1280__, __AVR_ATmega32U4__. Note that I don't know which of those actually need/support the workaround, so that will be part of testing a fix
Workaround from branch was tested by user, and confirmed to work properly
implemented in 847855c; new version to be released soon (see #46)