Browse Source

Support BUILTIN_SDCARD

main
PaulStoffregen 4 years ago
parent
commit
824a16eb06
1 changed files with 10 additions and 0 deletions
  1. +10
    -0
      src/SD.h

+ 10
- 0
src/SD.h View File

#include <FS.h> #include <FS.h>
#include <SdFat.h> #include <SdFat.h>


#if defined(__MK64FX512__) || defined(__MK66FX1M0__) || defined(__IMXRT1062__)
#define BUILTIN_SDCARD 254
#endif

class SDFile : public File class SDFile : public File
{ {
public: public:
public: public:
SDClass() { } SDClass() { }
bool begin(uint8_t csPin = 10) { bool begin(uint8_t csPin = 10) {
#ifdef BUILTIN_SDCARD
if (csPin == BUILTIN_SDCARD) {
return sdfs.begin(SdioConfig(FIFO_SDIO));
//return sdfs.begin(SdioConfig(DMA_SDIO));
}
#endif
return sdfs.begin(csPin, SD_SCK_MHZ(24)); return sdfs.begin(csPin, SD_SCK_MHZ(24));
} }
File open(const char *filepath, uint8_t mode = FILE_READ) { File open(const char *filepath, uint8_t mode = FILE_READ) {

Loading…
Cancel
Save