adafruit / Adafruit_ILI9341

Library for Adafruit ILI9341 displays
406 stars 281 forks source link

Only include wiring_private.h if it exists (Arduino UNO R4 support) #89

Closed KurtE closed 2 months ago

KurtE commented 1 year ago

Some of the new Arduino cores do not include this file. This includes the cores for the Arduino UNO Rev 4.

The change is limited to use the __has_include() preprocessor stuff be used to limit when arduino_private.h is included.

Two ways to fix this. 1) add it specifically to a list of cores to not include it, like this file has #ifndef RASPI

Or use GCC __has_include to detect it and then include it. With Arduino this will not work well for library headers, as the library search stuff will not see this as a dependency and as such won't add the -I to command line to find it. But this file is in core which is always on the search path

I ran this modified version on the UNO R4 Minima with the graphictest example.

mpechner commented 1 year ago

Do not want to causwe conflicts, but https://forum.arduino.cc/t/compilation-error-wiring-private-h-no-such-file-or-directory/1146752/2 Seems to have a more complete fix

#if defined(__has_include)
#if __has_include("wiring_private.h")
#include "wiring_private.h"
#endif  // __has_include("wiring_private.h")
#else  //defined(__has_include)
#include "wiring_private.h"
#endif  //defined(__has_include)
KurtE commented 1 year ago

Sounds good... Pushed up change

KurtE commented 2 months ago

Closing out detritus