Эх сурвалжийг харах

Fix for SparkFun Mbed Apollo3 Core

Bill Greiman 4 жил өмнө
parent
commit
a9f2b6f886

+ 0 - 0
src/common/PrintBasic.cpp → extras/attic/PrintBasic.cpp


+ 0 - 0
src/common/PrintBasic.h → extras/attic/PrintBasic.h


+ 0 - 0
src/common/PrintTemplates.h → extras/attic/PrintTemplates.h


+ 0 - 0
src/common/SysCallBareUno.cpp → extras/attic/SysCallBareUno.cpp


+ 1 - 1
library.properties

@@ -1,5 +1,5 @@
 name=SdFat
-version=2.0.5
+version=2.0.6
 license=MIT
 author=Bill Greiman <fat16lib@sbcglobal.net>
 maintainer=Bill Greiman <fat16lib@sbcglobal.net>

+ 1 - 1
src/ExFatLib/ExFatFormatter.cpp

@@ -201,7 +201,7 @@ bool ExFatFormatter::format(BlockDevice* dev, uint8_t* secBuf, print_t* pr) {
   memset(secBuf, 0, BYTES_PER_SECTOR);
   // Allocate two reserved clusters, bitmap, upcase, and root clusters.
   secBuf[0] = 0XF8;
-  for (size_t i = 0; i < 20; i++) {
+  for (size_t i = 1; i < 20; i++) {
     secBuf[i] = 0XFF;
   }
   for (uint32_t i = 0; i < ns; i++) {

+ 5 - 1
src/FatLib/FatFileLFN.cpp

@@ -359,7 +359,11 @@ bool FatFile::open(FatFile* dirFile, fname_t* fname, oflag_t oflag) {
         if ((ldir->order & FAT_ORDER_LAST_LONG_ENTRY) == 0) {
           continue;
         }
-        lfnOrd = order = ldir->order & 0X1F;
+        order = ldir->order & 0X1F;
+        if (order != (freeNeed - 1)) {
+          continue;
+        }
+        lfnOrd = order;
         checksum = ldir->checksum;
       } else if (ldir->order != --order || checksum != ldir->checksum) {
         lfnOrd = 0;

+ 2 - 2
src/SdFat.h

@@ -38,9 +38,9 @@
 #endif  // INCLUDE_SDIOS
 //------------------------------------------------------------------------------
 /** SdFat version  for cpp use. */
-#define SD_FAT_VERSION 20005
+#define SD_FAT_VERSION 20006
 /** SdFat version as string. */
-#define SD_FAT_VERSION_STR "2.0.5"
+#define SD_FAT_VERSION_STR "2.0.6"
 //==============================================================================
 /**
  * \class SdBase

+ 2 - 1
src/SpiDriver/SdSpiArtemis.cpp

@@ -47,7 +47,8 @@ uint8_t SdSpiArduinoDriver::receive() {
 }
 //------------------------------------------------------------------------------
 uint8_t SdSpiArduinoDriver::receive(uint8_t* buf, size_t count) {
-  m_spi->transferIn(buf, count);
+  memset(buf, 0XFF, count); 
+  m_spi->transfer(buf, count);
   return 0;
 }
 //------------------------------------------------------------------------------

+ 1 - 0
src/common/FsCache.cpp

@@ -22,6 +22,7 @@
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
  */
+#define DBG_FILE "FsCache.cpp"
 #include "DebugMacros.h"
 #include "FsCache.h"
 //------------------------------------------------------------------------------

+ 0 - 1
src/common/FsCache.h

@@ -30,7 +30,6 @@
  */
 #include "SysCall.h"
 #include "BlockDevice.h"
-#include "DebugMacros.h"
 /**
  * \class FsCache
  * \brief Sector cache.

+ 1 - 0
src/common/SysCall.h

@@ -94,6 +94,7 @@ inline void SysCall::yield() {}
 #endif  // defined(PLATFORM_ID)
 //------------------------------------------------------------------------------
 #else  // ENABLE_ARDUINO_FEATURES
+#error Print not defined
 #include "PrintBasic.h"
 /** If not Arduino */
 typedef PrintBasic print_t;

+ 2 - 2
src/iostream/istream.cpp

@@ -197,13 +197,13 @@ bool istream::getDouble(double* value) {
     if (exp & 1) {
       if (expNeg) {
         // check for underflow
-        if (v < FLT_MIN * pow10  && frac != 0) {
+        if (v < DBL_MIN * pow10  && frac != 0) {
           goto fail;
         }
         v /= pow10;
       } else {
         // check for overflow
-        if (v > FLT_MAX / pow10) {
+        if (v > DBL_MAX / pow10) {
           goto fail;
         }
         v *= pow10;