Skip to content

Commit

Permalink
Only include wiring_private.h if it exists
Browse files Browse the repository at this point in the history
Some of the new Arduino cores do not include this file.  This includes the cores for the Arduino UNO Rev 4.

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
  • Loading branch information
KurtE committed Sep 2, 2023
1 parent 0bfdfd5 commit 67103b5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Adafruit_ILI9341.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@
#ifndef ARDUINO_STM32_FEATHER
#include "pins_arduino.h"
#ifndef RASPI
#include "wiring_private.h"
#if defined __has_include
# if __has_include ("wiring_private.h")
# include "wiring_private.h"
# endif
#endif
#endif
#endif
#include <limits.h>
Expand Down

0 comments on commit 67103b5

Please sign in to comment.