Skip to content

Commit

Permalink
Fix for SparkFun Mbed Apollo3 Core
Browse files Browse the repository at this point in the history
  • Loading branch information
greiman committed Mar 22, 2021
1 parent 4582dd4 commit a9f2b6f
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 9 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
2 changes: 1 addition & 1 deletion src/ExFatLib/ExFatFormatter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down
6 changes: 5 additions & 1 deletion src/FatLib/FatFileLFN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/SdFat.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/SpiDriver/SdSpiArtemis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
//------------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions src/common/FsCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
//------------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion src/common/FsCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
*/
#include "SysCall.h"
#include "BlockDevice.h"
#include "DebugMacros.h"
/**
* \class FsCache
* \brief Sector cache.
Expand Down
1 change: 1 addition & 0 deletions src/common/SysCall.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/iostream/istream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a9f2b6f

Please sign in to comment.