sparkfun / SparkFun_ICM-20948_ArduinoLibrary

Arduino support for ICM_20948 w/ portable C backbone
Other
160 stars 69 forks source link

avr/pgmspace.h incorrectly included #78

Closed spacecheese closed 2 years ago

spacecheese commented 3 years ago

I'm using the C backend of this library on a raspberry pi. When compiling using arm-linux-gnueabihf-gcc the __arm__ macro is defined causing ICM_20948_C.c to attempt to include the avr/pgmspace.h header. I've corrected this in my local copy by changing line 11 from: #if defined(__AVR__) || defined(__arm__) || defined(__ARDUINO_ARC__) to #if defined(__AVR__) || defined(__ARDUINO_ARC__) I would submit a pull request but I'm not sure whether there was some reason for checking the __arm__ macro?

PaulZC commented 3 years ago

Hi Space Cheese (@spacecheese ), Cool handle! ;-) This is primarily an Arduino library. The three if defined cover the most common Arduino platforms which need the pgmspace header. If we remove the __arm__ case it is likely to cause the code to fail on some Arduino boards. If you have a tested solution which works on both Arduino and the Pi, I'd be happy to take a look. Best wishes, Paul

PaulZC commented 3 years ago

Maybe there is a Pi-specific identifier which we could and into the mix? #if (defined(__AVR__) || defined(__arm__) || defined(__ARDUINO_ARC__)) && !defined(__i_am_a_Pi__)

igor-markovic commented 2 years ago

Should this issue be closed now that the pull request has been merged?

PaulZC commented 2 years ago

Hi @igor-markovic ,

Thanks for the reminder!

I merged the changes into the _releasecandidate branch, but I have not released the changes in the main branch. I left this issue open as a reminder to do the release. I think I was waiting to include #73 first.

I will release the changes soon.

Best wishes, Paul

PaulZC commented 2 years ago

Merged in v1.2.8. Closing...