arduino-sps icon indicating copy to clipboard operation
arduino-sps copied to clipboard

Fix compilation on MegaAvr architectures

Open winkj opened this issue 3 years ago • 1 comments

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

winkj avatar Mar 30 '22 11:03 winkj

Workaround from branch was tested by user, and confirmed to work properly

winkj avatar Mar 30 '22 14:03 winkj

implemented in 847855c; new version to be released soon (see #46)

winkj avatar Aug 04 '23 14:08 winkj