Skip to content

Commit

Permalink
configure sdfat for spiflash and fat12 usage
Browse files Browse the repository at this point in the history
- SDFAT_FILE_TYPE = 1
- USE_BLOCK_DEVICE_INTERFACE = 1
- FAT12_SUPPORT = 1
- comment out FS.h warning
- add File32 name() function for backward compilable
  • Loading branch information
hathach committed Oct 11, 2022
1 parent 84abec8 commit d8351e1
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/FatLib/FatFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -1082,5 +1082,14 @@ class File32 : public StreamFile<FatFile, uint32_t> {
tmpFile.openNext(this, oflag);
return tmpFile;
}

/** No longer implemented due to Long File Names.
*
* Use getName(char* name, size_t size).
* \return a pointer to replacement suggestion.
*/
__attribute__((warning("use getName(name, size) instead"))) const char* name() const {
return "use getName()";
}
};
#endif // FatFile_h
2 changes: 1 addition & 1 deletion src/SdFat.h
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ typedef FsBaseFile SdBaseFile;
#if defined __has_include
#if __has_include(<FS.h>)
#define HAS_INCLUDE_FS_H
#warning File not defined because __has_include(FS.h)
// #warning File not defined because __has_include(FS.h)
#endif // __has_include(<FS.h>)
#endif // defined __has_include
#ifndef HAS_INCLUDE_FS_H
Expand Down
14 changes: 14 additions & 0 deletions src/SdFatConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@
#ifdef __AVR__
#include <avr/io.h>
#endif // __AVR__

//------------- Adafruit configuration -------------//
#ifndef SDFAT_FILE_TYPE
#define SDFAT_FILE_TYPE 1
#endif

#ifndef USE_BLOCK_DEVICE_INTERFACE
#define USE_BLOCK_DEVICE_INTERFACE 1
#endif

#ifndef FAT12_SUPPORT
#define FAT12_SUPPORT 1
#endif

//
// To try UTF-8 encoded filenames.
// #define USE_UTF8_LONG_NAMES 1
Expand Down

0 comments on commit d8351e1

Please sign in to comment.