Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
SPI.cpp includes "pins_arduino.h" unncessarily #1266
The file SPI.cpp includes:
However SPI.h includes Arduino.h which includes pins_arduino.h. So this additional include would seem to be unnecessary.
This breaks a compile under certain other boards (eg. Bobuino) because of some clash between C and C++ linkage.
See forum thread: http://arduino.cc/forum/index.php/topic,146968
inside all the pins_arduino.h files contained in the different variants folders we use include guards. This prevents problems associated with double inclusions.
Actually I don't know why the #include "pins_arduino.h" was placed inside the SPI.cpp file and I don't want to remove it to prevent problems with backward compatibility. Using the include guards all the Arduino boards compiles as expected, probably in the Bobuino pins_arduino.h file they forgot to use it.