您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

FatLibConfig.h 4.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /* FatLib Library
  2. * Copyright (C) 2013 by William Greiman
  3. *
  4. * This file is part of the FatLib Library
  5. *
  6. * This Library is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This Library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with the FatLib Library. If not, see
  18. * <http://www.gnu.org/licenses/>.
  19. */
  20. /**
  21. * \file
  22. * \brief configuration definitions
  23. */
  24. #ifndef FatLibConfig_h
  25. #define FatLibConfig_h
  26. #include <stdint.h>
  27. // Allow this file to override defaults.
  28. #include "../SdFatConfig.h"
  29. #ifdef __AVR__
  30. #include <avr/io.h>
  31. #endif // __AVR__
  32. //------------------------------------------------------------------------------
  33. /**
  34. * Set USE_LONG_FILE_NAMES nonzero to use long file names (LFN).
  35. * Long File Name are limited to a maximum length of 255 characters.
  36. *
  37. * This implementation allows 7-bit characters in the range
  38. * 0X20 to 0X7E. The following characters are not allowed:
  39. *
  40. * < (less than)
  41. * > (greater than)
  42. * : (colon)
  43. * " (double quote)
  44. * / (forward slash)
  45. * \ (backslash)
  46. * | (vertical bar or pipe)
  47. * ? (question mark)
  48. * * (asterisk)
  49. *
  50. */
  51. #ifndef USE_LONG_FILE_NAMES
  52. #define USE_LONG_FILE_NAMES 1
  53. #endif // USE_LONG_FILE_NAMES
  54. //------------------------------------------------------------------------------
  55. /**
  56. * Set ARDUINO_FILE_USES_STREAM nonzero to use Stream as the base class
  57. * for the Arduino File class. If ARDUINO_FILE_USES_STREAM is zero, Print
  58. * will be used as the base class for the Arduino File class.
  59. *
  60. * You can save some flash if you do not use Stream input functions such as
  61. * find(), findUntil(), readBytesUntil(), readString(), readStringUntil(),
  62. * parseInt(), and parsefloat().
  63. */
  64. #ifndef ARDUINO_FILE_USES_STREAM
  65. #define ARDUINO_FILE_USES_STREAM 1
  66. #endif // ARDUINO_FILE_USES_STREAM
  67. //------------------------------------------------------------------------------
  68. /**
  69. * Set USE_SEPARATE_FAT_CACHE non-zero to use a second 512 byte cache
  70. * for FAT table entries. Improves performance for large writes that
  71. * are not a multiple of 512 bytes.
  72. */
  73. #ifndef USE_SEPARATE_FAT_CACHE
  74. #ifdef __arm__
  75. #define USE_SEPARATE_FAT_CACHE 1
  76. #else // __arm__
  77. #define USE_SEPARATE_FAT_CACHE 0
  78. #endif // __arm__
  79. #endif // USE_SEPARATE_FAT_CACHE
  80. //------------------------------------------------------------------------------
  81. /**
  82. * Set USE_MULTI_BLOCK_IO non-zero to use multi-block SD read/write.
  83. *
  84. * Don't use mult-block read/write on small AVR boards.
  85. */
  86. #ifndef USE_MULTI_BLOCK_IO
  87. #if defined(RAMEND) && RAMEND < 3000
  88. #define USE_MULTI_BLOCK_IO 0
  89. #else // RAMEND
  90. #define USE_MULTI_BLOCK_IO 1
  91. #endif // RAMEND
  92. #endif // USE_MULTI_BLOCK_IO
  93. //------------------------------------------------------------------------------
  94. /**
  95. * Set DESTRUCTOR_CLOSES_FILE non-zero to close a file in its destructor.
  96. *
  97. * Causes use of lots of heap in ARM.
  98. */
  99. #ifndef DESTRUCTOR_CLOSES_FILE
  100. #define DESTRUCTOR_CLOSES_FILE 0
  101. #endif // DESTRUCTOR_CLOSES_FILE
  102. //------------------------------------------------------------------------------
  103. /**
  104. * Call flush for endl if ENDL_CALLS_FLUSH is non-zero
  105. *
  106. * The standard for iostreams is to call flush. This is very costly for
  107. * SdFat. Each call to flush causes 2048 bytes of I/O to the SD.
  108. *
  109. * SdFat has a single 512 byte buffer for I/O so it must write the current
  110. * data block to the SD, read the directory block from the SD, update the
  111. * directory entry, write the directory block to the SD and read the data
  112. * block back into the buffer.
  113. *
  114. * The SD flash memory controller is not designed for this many rewrites
  115. * so performance may be reduced by more than a factor of 100.
  116. *
  117. * If ENDL_CALLS_FLUSH is zero, you must call flush and/or close to force
  118. * all data to be written to the SD.
  119. */
  120. #ifndef ENDL_CALLS_FLUSH
  121. #define ENDL_CALLS_FLUSH 0
  122. #endif // ENDL_CALLS_FLUSH
  123. //------------------------------------------------------------------------------
  124. /**
  125. * Allow FAT12 volumes if FAT12_SUPPORT is non-zero.
  126. * FAT12 has not been well tested.
  127. */
  128. #ifndef FAT12_SUPPORT
  129. #define FAT12_SUPPORT 0
  130. #endif // FAT12_SUPPORT
  131. //------------------------------------------------------------------------------
  132. /**
  133. * Enable Extra features for Arduino.
  134. */
  135. #ifndef ENABLE_ARDUINO_FEATURES
  136. #if defined(ARDUINO) || defined(DOXYGEN)
  137. #define ENABLE_ARDUINO_FEATURES 1
  138. #else // #if defined(ARDUINO) || defined(DOXYGEN)
  139. #define ENABLE_ARDUINO_FEATURES 0
  140. #endif // defined(ARDUINO) || defined(DOXYGEN)
  141. #endif // ENABLE_ARDUINO_FEATURES
  142. #endif // FatLibConfig_h