adafruit / Adafruit_EPD

e-paper display driver for Arduino
140 stars 57 forks source link

Fix undefined reference to `Adafruit_EPD::fastSPIwrite for ARM with newer gcc #1

Closed PaulStoffregen closed 6 years ago

PaulStoffregen commented 6 years ago

This tiny patch fixes a compile error on Teensy 3.x, and probably other ARM boards when they update to gcc version 5.4 or later. Currently most of the Arduino world is still using gcc version 4.8.

I put ifdef checks, so the code remains exactly the same for all non-ARM, and all ARM boards using gcc 4.

Here's the forum thread where the problem was reported. https://forum.pjrc.com/threads/53412-Adafruit-1-54-quot-Tri-Color-eInk-with-Teensy

Here's a photo from the user who confirmed the fix works. :)

thanks

ladyada commented 6 years ago

thats odd, you cant have inline member functions? if so, probably best to just remove the inline keyword altogether, wanna do that and ill merge?

PaulStoffregen commented 6 years ago

Apparently to can with some versions of the compiler, but not with others (use it outside the same .cpp file).

PaulStoffregen commented 6 years ago

All the info I can find says to do inline within the .h file in the class definition, to avoid it in .cpp files. But to be honest, this is one of those finer points of C++ that I mostly ignore... until it causes a compile error.

ladyada commented 6 years ago

thanx! if you could create a travis ruleset for testing teensy, we'll add to our standard test-bed for all libraries!

PaulStoffregen commented 6 years ago

Thanks. Will work on travis support.

This will depend upon a command line only automated install. That's been a low priority feature, requested by only a few users so far. Will bump that up for my list on the next version, then look at adding to the script later this year.

ladyada commented 6 years ago

thanx - you can read about how we do our automation here https://learn.adafruit.com/the-well-automated-arduino-library as long as you can do it on linux somehow, it should be possible to automate. this will at least do compilation checks, also makes PR checking easier because non-compiling PRs will get auto-rejected