Il 12/02/2016 12:59, Phillip Stevens ha scritto:
> I can't find anywhere that uses the functions or data defined in this
> file, except for SD2Card.cpp, and then only the standard SPI defines.
> Am I missing something? Or, is this file just there for legacy
> compatibility?
That's not legacy, it's currently used for software emulating SPI on
pins where a real SPI master is not available. If you are wondering,
someone else already tried to convert the SD library into a
"board-agnostic SD library" using the macros from pins_arduino.h...
https://github.com/arduino/Arduino/pull/121
unfortunately this patch has a very bad impact on performance when using
software-SPI, see a bit more of discussion here:
https://github.com/arduino/Arduino/commit/05a9750747fcc3d5218acba8ae6a4fdacc6d017a#commitcomment-15657902
BTW I think that we can use your patch to at least use pins_arduino.h
when using the real hardware SPI, the only doubt is that removing the
#include "Sd2PinMap.h" will make the build fail when SOFTWARE_SPI is
enabled.
May you try to build the library SOFTWARE_SPI is defined? A very common
case is changing #define MEGA_SOFT_SPI 0 to 1 and building for the
Mega2560.
C