Browse Source

Default for ARM and avoid "File" conflict with FS.h

main
PaulStoffregen 4 years ago
parent
commit
7144a9aecc
2 changed files with 9 additions and 0 deletions
  1. +6
    -0
      src/SdFat.h
  2. +3
    -0
      src/SdFatConfig.h

+ 6
- 0
src/SdFat.h View File

/** Select type for SdFat. */ /** Select type for SdFat. */
typedef SdFat32 SdFat; typedef SdFat32 SdFat;
/** Select type for File. */ /** Select type for File. */
#if !defined(__has_include) || !__has_include(<FS.h>)
typedef File32 File; typedef File32 File;
#endif
/** Select type for SdBaseFile. */ /** Select type for SdBaseFile. */
typedef FatFile SdBaseFile; typedef FatFile SdBaseFile;
#elif SDFAT_FILE_TYPE == 2 #elif SDFAT_FILE_TYPE == 2
typedef SdExFat SdFat; typedef SdExFat SdFat;
#if !defined(__has_include) || !__has_include(<FS.h>)
typedef ExFile File; typedef ExFile File;
#endif
typedef ExFatFile SdBaseFile; typedef ExFatFile SdBaseFile;
#elif SDFAT_FILE_TYPE == 3 #elif SDFAT_FILE_TYPE == 3
typedef SdFs SdFat; typedef SdFs SdFat;
#if !defined(__has_include) || !__has_include(<FS.h>)
typedef FsFile File; typedef FsFile File;
#endif
typedef FsBaseFile SdBaseFile; typedef FsBaseFile SdBaseFile;
#else // SDFAT_FILE_TYPE #else // SDFAT_FILE_TYPE
#error Invalid SDFAT_FILE_TYPE #error Invalid SDFAT_FILE_TYPE

+ 3
- 0
src/SdFatConfig.h View File

#if defined(__AVR__) && FLASHEND < 0X8000 #if defined(__AVR__) && FLASHEND < 0X8000
// 32K AVR boards. // 32K AVR boards.
#define SDFAT_FILE_TYPE 1 #define SDFAT_FILE_TYPE 1
#elif defined(__arm__)
// ARM boards usually have plenty of memory
#define SDFAT_FILE_TYPE 3
#else // defined(__AVR__) && FLASHEND < 0X8000 #else // defined(__AVR__) && FLASHEND < 0X8000
// All other boards. // All other boards.
#define SDFAT_FILE_TYPE 1 #define SDFAT_FILE_TYPE 1

Loading…
Cancel
Save