From 11d6d9ccf4aafce4ec22c21c81d6e3bcd58da74b Mon Sep 17 00:00:00 2001 From: Bill Greiman Date: Sat, 23 Dec 2017 07:16:52 -0800 Subject: [PATCH] Fix for low power sleep --- library.properties | 2 +- src/SdCard/SdSpiCard.cpp | 4 ++-- src/SdFat.h | 2 +- src/SdFatConfig.h | 10 ++++++++++ 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/library.properties b/library.properties index 4ea2a083..e674f66d 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=SdFat -version=1.0.4 +version=1.0.5 author=Bill Greiman maintainer=Bill Greiman sentence=FAT16/FAT32 file system for SD cards. diff --git a/src/SdCard/SdSpiCard.cpp b/src/SdCard/SdSpiCard.cpp index f41e738f..1b54f27a 100644 --- a/src/SdCard/SdSpiCard.cpp +++ b/src/SdCard/SdSpiCard.cpp @@ -539,8 +539,8 @@ bool SdSpiCard::writeBlock(uint32_t blockNumber, const uint8_t* src) { goto fail; } -#define CHECK_PROGRAMMING 0 -#if CHECK_PROGRAMMING + +#if CHECK_FLASH_PROGRAMMING // wait for flash programming to complete if (!waitNotBusy(SD_WRITE_TIMEOUT)) { error(SD_CARD_ERROR_WRITE_TIMEOUT); diff --git a/src/SdFat.h b/src/SdFat.h index 3ba6d7fd..99c78319 100644 --- a/src/SdFat.h +++ b/src/SdFat.h @@ -34,7 +34,7 @@ #include "SdCard/SdioCard.h" //------------------------------------------------------------------------------ /** SdFat version */ -#define SD_FAT_VERSION "1.0.4" +#define SD_FAT_VERSION "1.0.5" //============================================================================== /** * \class SdBaseFile diff --git a/src/SdFatConfig.h b/src/SdFatConfig.h index 58a19b6b..9e7127d9 100644 --- a/src/SdFatConfig.h +++ b/src/SdFatConfig.h @@ -78,6 +78,16 @@ */ #define ENABLE_SOFTWARE_SPI_CLASS 0 //------------------------------------------------------------------------------ +/** + * If CHECK_FLASH_PROGRAMMING is zero, overlap of single sector flash + * programming and other operations will be allowed for faster write + * performance. + * + * Some cards will not sleep in low power mode unless CHECK_FLASH_PROGRAMMING + * is non-zero. + */ +#define CHECK_FLASH_PROGRAMMING 1 +//------------------------------------------------------------------------------ /** * Set MAINTAIN_FREE_CLUSTER_COUNT nonzero to keep the count of free clusters * updated. This will increase the speed of the freeClusterCount() call