Skip to content

Allow using this library on esp boards #129

Open
@gasagna

Description

@gasagna

I am trying to use this library on an esp32 dev board, since the SD library that comes with the arduino-esp32 library (mentioned in some other issues here) is not as feature-complete as this one and leads to random behaviour with some SD cards I have.

I have attempted to compile my project using this library (and other libs from arduino-esp32, e.g. SPI, ) and I got a

/Users/gasagna/Documents/Arduino/libraries/SD/src/utility/Sd2PinMap.h:524:4: error: #error Architecture or board not supported.
   #error Architecture or board not supported.
    ^~~~~

suggesting that my board is not supported. Well, OK, but ...

I then commented the compile #error directive at the end of Sd2PinMap.h to get

#else
  //   #error Architecture or board not supported.
#endif

and then initialised the SD card using the appropriate pins for my board, e.g. with

// sd card pins
#define SD_MISO  2
#define SD_MOSI  15
#define SD_SCLK  14
#define SD_CS    13

SPI.begin(SD_SCLK, SD_MISO, SD_MOSI, SD_CS);
SD.begin(SD_CS);

The code not only compiles, but works like a charm.

I wonder what would be the consequences of removing that error directive, or maybe turning it into a more permissive compilation warning.

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: codeRelated to content of the project itselftype: enhancementProposed improvement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions