Skip to content

avr/pgmspace.h incorrectly included #78

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spacecheese opened this issue Jul 14, 2021 · 5 comments · Fixed by #79
Closed

avr/pgmspace.h incorrectly included #78

spacecheese opened this issue Jul 14, 2021 · 5 comments · Fixed by #79

Comments

@spacecheese
Copy link
Contributor

spacecheese commented Jul 14, 2021

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
Copy link
Contributor

PaulZC commented Jul 15, 2021

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
Copy link
Contributor

PaulZC commented Jul 15, 2021

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
Copy link

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

@PaulZC
Copy link
Contributor

PaulZC commented Nov 15, 2021

Hi @igor-markovic ,

Thanks for the reminder!

I merged the changes into the release_candidate 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
Copy link
Contributor

PaulZC commented Nov 15, 2021

Merged in v1.2.8. Closing...

@PaulZC PaulZC closed this as completed Nov 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants