| * \file | * \file | ||||
| * \brief Fast buffered print. | * \brief Fast buffered print. | ||||
| */ | */ | ||||
| #include "common/FmtNumber.h" | |||||
| #include "./common/FmtNumber.h" | |||||
| /** | /** | ||||
| * \class BufferedPrint | * \class BufferedPrint | ||||
| * \brief Fast buffered print template. | * \brief Fast buffered print template. |
| #define GPIO_PIN(reg, bit) {&PIN##reg, &DDR##reg, &PORT##reg, 1 << bit} | #define GPIO_PIN(reg, bit) {&PIN##reg, &DDR##reg, &PORT##reg, 1 << bit} | ||||
| // Include pin map for current board. | // Include pin map for current board. | ||||
| #include "boards/GpioPinMap.h" | |||||
| #include "./boards/GpioPinMap.h" | |||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ | ||||
| /** generate bad pin number error */ | /** generate bad pin number error */ | ||||
| void badPinNumber(void) | void badPinNumber(void) |
| * <http://www.gnu.org/licenses/>. | * <http://www.gnu.org/licenses/>. | ||||
| */ | */ | ||||
| /** | /** | ||||
| * @file | |||||
| * @file | |||||
| * @brief Software SPI. | * @brief Software SPI. | ||||
| * | * | ||||
| * @defgroup softSPI Software SPI | * @defgroup softSPI Software SPI | ||||
| */ | */ | ||||
| #ifndef SoftSPI_h | #ifndef SoftSPI_h | ||||
| #define SoftSPI_h | #define SoftSPI_h | ||||
| #include "DigitalPin.h" | |||||
| #include "./DigitalPin.h" | |||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ | ||||
| /** Nop for timing. */ | /** Nop for timing. */ | ||||
| #define nop asm volatile ("nop\n\t") | #define nop asm volatile ("nop\n\t") |
| ||defined(__AVR_ATmega168P__)\ | ||defined(__AVR_ATmega168P__)\ | ||||
| ||defined(__AVR_ATmega328P__) | ||defined(__AVR_ATmega328P__) | ||||
| // 168 and 328 Arduinos | // 168 and 328 Arduinos | ||||
| #include "UnoGpioPinMap.h" | |||||
| #include "./UnoGpioPinMap.h" | |||||
| #elif defined(__AVR_ATmega1280__)\ | #elif defined(__AVR_ATmega1280__)\ | ||||
| || defined(__AVR_ATmega2560__) | || defined(__AVR_ATmega2560__) | ||||
| // Mega ADK | // Mega ADK | ||||
| #include "MegaGpioPinMap.h" | |||||
| #include "./MegaGpioPinMap.h" | |||||
| #elif defined(__AVR_ATmega32U4__) | #elif defined(__AVR_ATmega32U4__) | ||||
| #ifdef CORE_TEENSY | #ifdef CORE_TEENSY | ||||
| #include "Teensy2GpioPinMap.h" | |||||
| #include "./Teensy2GpioPinMap.h" | |||||
| #else // CORE_TEENSY | #else // CORE_TEENSY | ||||
| // Leonardo or Yun | // Leonardo or Yun | ||||
| #include "LeonardoGpioPinMap.h" | |||||
| #include "./LeonardoGpioPinMap.h" | |||||
| #endif // CORE_TEENSY | #endif // CORE_TEENSY | ||||
| #elif defined(__AVR_AT90USB646__)\ | #elif defined(__AVR_AT90USB646__)\ | ||||
| || defined(__AVR_AT90USB1286__) | || defined(__AVR_AT90USB1286__) | ||||
| // Teensy++ 1.0 & 2.0 | // Teensy++ 1.0 & 2.0 | ||||
| #include "Teensy2ppGpioPinMap.h" | |||||
| #include "./Teensy2ppGpioPinMap.h" | |||||
| #elif defined(__AVR_ATmega1284P__)\ | #elif defined(__AVR_ATmega1284P__)\ | ||||
| || defined(__AVR_ATmega1284__)\ | || defined(__AVR_ATmega1284__)\ | ||||
| || defined(__AVR_ATmega644P__)\ | || defined(__AVR_ATmega644P__)\ | ||||
| || defined(__AVR_ATmega324__)\ | || defined(__AVR_ATmega324__)\ | ||||
| || defined(__AVR_ATmega16__) | || defined(__AVR_ATmega16__) | ||||
| #ifdef ARDUINO_1284P_AVR_DEVELOPERS | #ifdef ARDUINO_1284P_AVR_DEVELOPERS | ||||
| #include "AvrDevelopersGpioPinMap.h" | |||||
| #include "./AvrDevelopersGpioPinMap.h" | |||||
| #elif defined(ARDUINO_1284P_BOBUINO) | #elif defined(ARDUINO_1284P_BOBUINO) | ||||
| #include "BobuinoGpioPinMap.h" | |||||
| #include "./BobuinoGpioPinMap.h" | |||||
| #elif defined(ARDUINO_1284P_SLEEPINGBEAUTY) | #elif defined(ARDUINO_1284P_SLEEPINGBEAUTY) | ||||
| #include "SleepingBeautyGpioPinMap.h" | |||||
| #include "./SleepingBeautyGpioPinMap.h" | |||||
| #elif defined(ARDUINO_1284P_STANDARD) | #elif defined(ARDUINO_1284P_STANDARD) | ||||
| #include "Standard1284GpioPinMap.h" | |||||
| #include "./Standard1284GpioPinMap.h" | |||||
| #else // ARDUINO_1284P_SLEEPINGBEAUTY | #else // ARDUINO_1284P_SLEEPINGBEAUTY | ||||
| #error Undefined variant 1284, 644, 324 | #error Undefined variant 1284, 644, 324 | ||||
| #endif // ARDUINO_1284P_SLEEPINGBEAUTY | #endif // ARDUINO_1284P_SLEEPINGBEAUTY |
| * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||||
| * DEALINGS IN THE SOFTWARE. | * DEALINGS IN THE SOFTWARE. | ||||
| */ | */ | ||||
| #include "ExFatVolume.h" | |||||
| #include "upcase.h" | |||||
| #include "ExFatFile.h" | |||||
| #include "./ExFatVolume.h" | |||||
| #include "./upcase.h" | |||||
| #include "./ExFatFile.h" | |||||
| #include "../common/FsDateTime.h" | #include "../common/FsDateTime.h" | ||||
| #ifndef DOXYGEN_SHOULD_SKIP_THIS | #ifndef DOXYGEN_SHOULD_SKIP_THIS | ||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ |
| */ | */ | ||||
| #define DBG_FILE "ExFatFile.cpp" | #define DBG_FILE "ExFatFile.cpp" | ||||
| #include "../common/DebugMacros.h" | #include "../common/DebugMacros.h" | ||||
| #include "ExFatFile.h" | |||||
| #include "ExFatVolume.h" | |||||
| #include "upcase.h" | |||||
| #include "./ExFatFile.h" | |||||
| #include "./ExFatVolume.h" | |||||
| #include "./upcase.h" | |||||
| //----------------------------------------------------------------------------- | //----------------------------------------------------------------------------- | ||||
| bool ExFatFile::close() { | bool ExFatFile::close() { | ||||
| bool rtn = sync(); | bool rtn = sync(); |
| */ | */ | ||||
| #include <limits.h> | #include <limits.h> | ||||
| #include <string.h> | #include <string.h> | ||||
| #include "ExFatConfig.h" | |||||
| #include "./ExFatConfig.h" | |||||
| #include "../common/FsDateTime.h" | #include "../common/FsDateTime.h" | ||||
| #include "../common/FsStructs.h" | #include "../common/FsStructs.h" | ||||
| #include "../common/FsApiConstants.h" | #include "../common/FsApiConstants.h" | ||||
| #include "../common/FmtNumber.h" | #include "../common/FmtNumber.h" | ||||
| #include "ExFatTypes.h" | |||||
| #include "ExFatPartition.h" | |||||
| #include "./ExFatTypes.h" | |||||
| #include "./ExFatPartition.h" | |||||
| class ExFatVolume; | class ExFatVolume; | ||||
| */ | */ | ||||
| #define DBG_FILE "ExFatFilePrint.cpp" | #define DBG_FILE "ExFatFilePrint.cpp" | ||||
| #include "../common/DebugMacros.h" | #include "../common/DebugMacros.h" | ||||
| #include "ExFatFile.h" | |||||
| #include "upcase.h" | |||||
| #include "ExFatVolume.h" | |||||
| #include "./ExFatFile.h" | |||||
| #include "./upcase.h" | |||||
| #include "./ExFatVolume.h" | |||||
| //----------------------------------------------------------------------------- | //----------------------------------------------------------------------------- | ||||
| size_t ExFatFile::printFileSize(print_t* pr) { | size_t ExFatFile::printFileSize(print_t* pr) { | ||||
| uint64_t n = m_validLength; | uint64_t n = m_validLength; |
| */ | */ | ||||
| #define DBG_FILE "ExFatFileWrite.cpp" | #define DBG_FILE "ExFatFileWrite.cpp" | ||||
| #include "../common/DebugMacros.h" | #include "../common/DebugMacros.h" | ||||
| #include "ExFatFile.h" | |||||
| #include "ExFatVolume.h" | |||||
| #include "upcase.h" | |||||
| #include "./ExFatFile.h" | |||||
| #include "./ExFatVolume.h" | |||||
| #include "./upcase.h" | |||||
| //============================================================================= | //============================================================================= | ||||
| #if READ_ONLY | #if READ_ONLY | ||||
| bool ExFatFile::sync() { | bool ExFatFile::sync() { |
| */ | */ | ||||
| #define DBG_FILE "ExFatFormatter.cpp" | #define DBG_FILE "ExFatFormatter.cpp" | ||||
| #include "../common/DebugMacros.h" | #include "../common/DebugMacros.h" | ||||
| #include "ExFatFormatter.h" | |||||
| #include "./ExFatFormatter.h" | |||||
| //----------------------------------------------------------------------------- | //----------------------------------------------------------------------------- | ||||
| // Formatter assumes 512 byte sectors. | // Formatter assumes 512 byte sectors. | ||||
| const uint32_t BOOT_BACKUP_OFFSET = 12; | const uint32_t BOOT_BACKUP_OFFSET = 12; |
| */ | */ | ||||
| #ifndef ExFatFormatter_h | #ifndef ExFatFormatter_h | ||||
| #define ExFatFormatter_h | #define ExFatFormatter_h | ||||
| #include "ExFatConfig.h" | |||||
| #include "./ExFatConfig.h" | |||||
| #include "../common/SysCall.h" | #include "../common/SysCall.h" | ||||
| #include "../common/BlockDevice.h" | #include "../common/BlockDevice.h" | ||||
| #include "upcase.h" | |||||
| #include "./upcase.h" | |||||
| /** | /** | ||||
| * \class ExFatFormatter | * \class ExFatFormatter | ||||
| * \brief Format an exFAT volume. | * \brief Format an exFAT volume. |
| */ | */ | ||||
| #ifndef ExFatLib_h | #ifndef ExFatLib_h | ||||
| #define ExFatLib_h | #define ExFatLib_h | ||||
| #include "ExFatVolume.h" | |||||
| #include "ExFatFile.h" | |||||
| #include "ExFatFormatter.h" | |||||
| #include "./ExFatVolume.h" | |||||
| #include "./ExFatFile.h" | |||||
| #include "./ExFatFormatter.h" | |||||
| #endif // ExFatLib_h | #endif // ExFatLib_h |
| */ | */ | ||||
| #define DBG_FILE "ExFatPartition.cpp" | #define DBG_FILE "ExFatPartition.cpp" | ||||
| #include "../common/DebugMacros.h" | #include "../common/DebugMacros.h" | ||||
| #include "ExFatVolume.h" | |||||
| #include "./ExFatVolume.h" | |||||
| #include "../common/FsStructs.h" | #include "../common/FsStructs.h" | ||||
| //----------------------------------------------------------------------------- | //----------------------------------------------------------------------------- | ||||
| void FsCache::invalidate() { | void FsCache::invalidate() { |
| */ | */ | ||||
| #include "../common/SysCall.h" | #include "../common/SysCall.h" | ||||
| #include "../common/BlockDevice.h" | #include "../common/BlockDevice.h" | ||||
| #include "ExFatConfig.h" | |||||
| #include "ExFatTypes.h" | |||||
| #include "./ExFatConfig.h" | |||||
| #include "./ExFatTypes.h" | |||||
| /** Type for exFAT partition */ | /** Type for exFAT partition */ | ||||
| const uint8_t FAT_TYPE_EXFAT = 64; | const uint8_t FAT_TYPE_EXFAT = 64; | ||||
| */ | */ | ||||
| #ifndef ExFatTypes_h | #ifndef ExFatTypes_h | ||||
| #define ExFatTypes_h | #define ExFatTypes_h | ||||
| #include "ExFatConfig.h" | |||||
| #include "./ExFatConfig.h" | |||||
| #if __cplusplus < 201103 | #if __cplusplus < 201103 | ||||
| #warning no char16_t | #warning no char16_t |
| * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||||
| * DEALINGS IN THE SOFTWARE. | * DEALINGS IN THE SOFTWARE. | ||||
| */ | */ | ||||
| #include "ExFatVolume.h" | |||||
| #include "./ExFatVolume.h" | |||||
| ExFatVolume* ExFatVolume::m_cwv = nullptr; | ExFatVolume* ExFatVolume::m_cwv = nullptr; | ||||
| //---------------------------------------------------------------------------- | //---------------------------------------------------------------------------- | ||||
| bool ExFatVolume::chdir(const ExChar_t* path) { | bool ExFatVolume::chdir(const ExChar_t* path) { |
| */ | */ | ||||
| #ifndef ExFatVolume_h | #ifndef ExFatVolume_h | ||||
| #define ExFatVolume_h | #define ExFatVolume_h | ||||
| #include "ExFatPartition.h" | |||||
| #include "ExFatFile.h" | |||||
| #include "./ExFatPartition.h" | |||||
| #include "./ExFatFile.h" | |||||
| //============================================================================= | //============================================================================= | ||||
| /** | /** | ||||
| * \class ExFatVolume | * \class ExFatVolume |
| * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||||
| * DEALINGS IN THE SOFTWARE. | * DEALINGS IN THE SOFTWARE. | ||||
| */ | */ | ||||
| #include "upcase.h" | |||||
| #include "./upcase.h" | |||||
| #ifdef __AVR__ | #ifdef __AVR__ | ||||
| #include <avr/pgmspace.h> | #include <avr/pgmspace.h> |
| */ | */ | ||||
| #ifndef upcase_h | #ifndef upcase_h | ||||
| #define upcase_h | #define upcase_h | ||||
| #include "ExFatFile.h" | |||||
| #include "./ExFatFile.h" | |||||
| bool exFatCmpName(const DirName_t* unicode, | bool exFatCmpName(const DirName_t* unicode, | ||||
| const char* name, size_t offset, size_t n); | const char* name, size_t offset, size_t n); | ||||
| bool exFatCmpName(const DirName_t* unicode, | bool exFatCmpName(const DirName_t* unicode, |
| * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||||
| * DEALINGS IN THE SOFTWARE. | * DEALINGS IN THE SOFTWARE. | ||||
| */ | */ | ||||
| #include "FatVolume.h" | |||||
| #include "FatFile.h" | |||||
| #include "./FatVolume.h" | |||||
| #include "./FatFile.h" | |||||
| #include "../common/FsDateTime.h" | #include "../common/FsDateTime.h" | ||||
| #ifndef DOXYGEN_SHOULD_SKIP_THIS | #ifndef DOXYGEN_SHOULD_SKIP_THIS | ||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ |
| */ | */ | ||||
| #define DBG_FILE "FatFile.cpp" | #define DBG_FILE "FatFile.cpp" | ||||
| #include "../common/DebugMacros.h" | #include "../common/DebugMacros.h" | ||||
| #include "FatFile.h" | |||||
| #include "FatVolume.h" | |||||
| #include "./FatFile.h" | |||||
| #include "./FatVolume.h" | |||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ | ||||
| // Add a cluster to a file. | // Add a cluster to a file. | ||||
| bool FatFile::addCluster() { | bool FatFile::addCluster() { |
| #include <string.h> | #include <string.h> | ||||
| #include <stddef.h> | #include <stddef.h> | ||||
| #include <limits.h> | #include <limits.h> | ||||
| #include "FatLibConfig.h" | |||||
| #include "./FatLibConfig.h" | |||||
| #include "../common/FmtNumber.h" | #include "../common/FmtNumber.h" | ||||
| #include "../common/FsApiConstants.h" | #include "../common/FsApiConstants.h" | ||||
| #include "../common/FsDateTime.h" | #include "../common/FsDateTime.h" | ||||
| #include "../common/FsStructs.h" | #include "../common/FsStructs.h" | ||||
| #include "FatPartition.h" | |||||
| #include "./FatPartition.h" | |||||
| class FatVolume; | class FatVolume; | ||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ | ||||
| // Stuff to store strings in AVR flash. | // Stuff to store strings in AVR flash. |
| */ | */ | ||||
| #define DBG_FILE "FatFileLFN.cpp" | #define DBG_FILE "FatFileLFN.cpp" | ||||
| #include "../common/DebugMacros.h" | #include "../common/DebugMacros.h" | ||||
| #include "FatFile.h" | |||||
| #include "FatVolume.h" | |||||
| #include "./FatFile.h" | |||||
| #include "./FatVolume.h" | |||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ | ||||
| // | // | ||||
| uint8_t FatFile::lfnChecksum(uint8_t* name) { | uint8_t FatFile::lfnChecksum(uint8_t* name) { |
| #include <math.h> | #include <math.h> | ||||
| #define DBG_FILE "FatFilePrint.cpp" | #define DBG_FILE "FatFilePrint.cpp" | ||||
| #include "../common/DebugMacros.h" | #include "../common/DebugMacros.h" | ||||
| #include "FatFile.h" | |||||
| #include "./FatFile.h" | |||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ | ||||
| static void printHex(print_t* pr, uint8_t w, uint16_t h) { | static void printHex(print_t* pr, uint8_t w, uint16_t h) { | ||||
| char buf[5]; | char buf[5]; |
| #define DBG_FILE "FatFileSFN.cpp" | #define DBG_FILE "FatFileSFN.cpp" | ||||
| #include "../common/DebugMacros.h" | #include "../common/DebugMacros.h" | ||||
| #include "../common/FsStructs.h" | #include "../common/FsStructs.h" | ||||
| #include "FatFile.h" | |||||
| #include "FatVolume.h" | |||||
| #include "./FatFile.h" | |||||
| #include "./FatVolume.h" | |||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ | ||||
| bool FatFile::getSFN(char* name) { | bool FatFile::getSFN(char* name) { | ||||
| uint8_t j = 0; | uint8_t j = 0; |
| * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||||
| * DEALINGS IN THE SOFTWARE. | * DEALINGS IN THE SOFTWARE. | ||||
| */ | */ | ||||
| #include "FatFormatter.h" | |||||
| #include "./FatFormatter.h" | |||||
| // Set nonzero to use calculated CHS in MBR. Should not be required. | // Set nonzero to use calculated CHS in MBR. Should not be required. | ||||
| #define USE_LBA_TO_CHS 0 | #define USE_LBA_TO_CHS 0 | ||||
| */ | */ | ||||
| #ifndef FatFormatter_h | #ifndef FatFormatter_h | ||||
| #define FatFormatter_h | #define FatFormatter_h | ||||
| #include "FatFile.h" | |||||
| #include "./FatFile.h" | |||||
| #include "../common/SysCall.h" | #include "../common/SysCall.h" | ||||
| #include "../common/BlockDevice.h" | #include "../common/BlockDevice.h" | ||||
| #include "../common/FsStructs.h" | #include "../common/FsStructs.h" |
| */ | */ | ||||
| #ifndef FatLib_h | #ifndef FatLib_h | ||||
| #define FatLib_h | #define FatLib_h | ||||
| #include "FatVolume.h" | |||||
| #include "FatLibConfig.h" | |||||
| #include "FatFormatter.h" | |||||
| #include "./FatVolume.h" | |||||
| #include "./FatLibConfig.h" | |||||
| #include "./FatFormatter.h" | |||||
| #endif // FatLib_h | #endif // FatLib_h |
| */ | */ | ||||
| #ifndef FatLibConfig_h | #ifndef FatLibConfig_h | ||||
| #define FatLibConfig_h | #define FatLibConfig_h | ||||
| #include "SdFatConfig.h" | |||||
| #include "../SdFatConfig.h" | |||||
| #endif // FatLibConfig_h | #endif // FatLibConfig_h |
| #define DBG_FILE "FatPartition.cpp" | #define DBG_FILE "FatPartition.cpp" | ||||
| #include "../common/DebugMacros.h" | #include "../common/DebugMacros.h" | ||||
| #include "../common/FsStructs.h" | #include "../common/FsStructs.h" | ||||
| #include "FatPartition.h" | |||||
| #include "./FatPartition.h" | |||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ | ||||
| cache_t* FatCache::read(uint32_t sector, uint8_t option) { | cache_t* FatCache::read(uint32_t sector, uint8_t option) { | ||||
| if (m_lbn != sector) { | if (m_lbn != sector) { |
| * \brief FatPartition class | * \brief FatPartition class | ||||
| */ | */ | ||||
| #include <stddef.h> | #include <stddef.h> | ||||
| #include "FatLibConfig.h" | |||||
| #include "./FatLibConfig.h" | |||||
| #include "../common/SysCall.h" | #include "../common/SysCall.h" | ||||
| #include "../common/BlockDevice.h" | #include "../common/BlockDevice.h" | ||||
| #include "../common/FsStructs.h" | #include "../common/FsStructs.h" |
| * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||||
| * DEALINGS IN THE SOFTWARE. | * DEALINGS IN THE SOFTWARE. | ||||
| */ | */ | ||||
| #include "FatVolume.h" | |||||
| #include "./FatVolume.h" | |||||
| FatVolume* FatVolume::m_cwv = nullptr; | FatVolume* FatVolume::m_cwv = nullptr; | ||||
| //---------------------------------------------------------------------------- | //---------------------------------------------------------------------------- | ||||
| bool FatVolume::chdir(const char *path) { | bool FatVolume::chdir(const char *path) { |
| */ | */ | ||||
| #ifndef FatVolume_h | #ifndef FatVolume_h | ||||
| #define FatVolume_h | #define FatVolume_h | ||||
| #include "FatPartition.h" | |||||
| #include "FatFile.h" | |||||
| #include "./FatPartition.h" | |||||
| #include "./FatFile.h" | |||||
| /** | /** | ||||
| * \file | * \file | ||||
| * \brief FatVolume class | * \brief FatVolume class |
| * DEALINGS IN THE SOFTWARE. | * DEALINGS IN THE SOFTWARE. | ||||
| */ | */ | ||||
| #define FREE_STACK_CPP | #define FREE_STACK_CPP | ||||
| #include "FreeStack.h" | |||||
| #include "./FreeStack.h" | |||||
| #if defined(HAS_UNUSED_STACK) && HAS_UNUSED_STACK | #if defined(HAS_UNUSED_STACK) && HAS_UNUSED_STACK | ||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ | ||||
| inline char* stackBegin() { | inline char* stackBegin() { |
| #elif defined(ARDUINO_ARCH_APOLLO3) | #elif defined(ARDUINO_ARCH_APOLLO3) | ||||
| #define HAS_UNUSED_STACK 0 | #define HAS_UNUSED_STACK 0 | ||||
| #elif defined(PLATFORM_ID) // Particle board | #elif defined(PLATFORM_ID) // Particle board | ||||
| #include "Arduino.h" | |||||
| #include <core/Arduino.h> | |||||
| inline int FreeStack() { | inline int FreeStack() { | ||||
| return System.freeMemory(); | return System.freeMemory(); | ||||
| } | } |
| * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||||
| * DEALINGS IN THE SOFTWARE. | * DEALINGS IN THE SOFTWARE. | ||||
| */ | */ | ||||
| #include "FsLib.h" | |||||
| #include "./FsLib.h" | |||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ | ||||
| FsBaseFile::FsBaseFile(const FsBaseFile& from) { | FsBaseFile::FsBaseFile(const FsBaseFile& from) { | ||||
| m_fFile = nullptr; | m_fFile = nullptr; |
| * \file | * \file | ||||
| * \brief FsBaseFile include file. | * \brief FsBaseFile include file. | ||||
| */ | */ | ||||
| #include "FsNew.h" | |||||
| #include "FatLib/FatLib.h" | |||||
| #include "ExFatLib/ExFatLib.h" | |||||
| #include "./FsNew.h" | |||||
| #include "../FatLib/FatLib.h" | |||||
| #include "../ExFatLib/ExFatLib.h" | |||||
| /** | /** | ||||
| * \class FsBaseFile | * \class FsBaseFile | ||||
| * \brief FsBaseFile class. | * \brief FsBaseFile class. |
| * \file | * \file | ||||
| * \brief FsLib include file. | * \brief FsLib include file. | ||||
| */ | */ | ||||
| #include "FsVolume.h" | |||||
| #include "FsFile.h" | |||||
| #include "./FsVolume.h" | |||||
| #include "./FsFile.h" | |||||
| #endif // FsLib_h | #endif // FsLib_h |
| * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||||
| * DEALINGS IN THE SOFTWARE. | * DEALINGS IN THE SOFTWARE. | ||||
| */ | */ | ||||
| #include "FsNew.h" | |||||
| #include "./FsNew.h" | |||||
| void* operator new(size_t size, newalign_t* ptr) { | void* operator new(size_t size, newalign_t* ptr) { | ||||
| (void)size; | (void)size; | ||||
| return ptr; | return ptr; |
| * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||||
| * DEALINGS IN THE SOFTWARE. | * DEALINGS IN THE SOFTWARE. | ||||
| */ | */ | ||||
| #include "FsLib.h" | |||||
| #include "./FsLib.h" | |||||
| FsVolume* FsVolume::m_cwv = nullptr; | FsVolume* FsVolume::m_cwv = nullptr; | ||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ | ||||
| bool FsVolume::begin(BlockDevice* blockDev) { | bool FsVolume::begin(BlockDevice* blockDev) { |
| * \file | * \file | ||||
| * \brief FsVolume include file. | * \brief FsVolume include file. | ||||
| */ | */ | ||||
| #include "FsNew.h" | |||||
| #include "./FsNew.h" | |||||
| #include "../FatLib/FatLib.h" | #include "../FatLib/FatLib.h" | ||||
| #include "../ExFatLib/ExFatLib.h" | #include "../ExFatLib/ExFatLib.h" | ||||
| * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||||
| * DEALINGS IN THE SOFTWARE. | * DEALINGS IN THE SOFTWARE. | ||||
| */ | */ | ||||
| #include "common/SysCall.h" | |||||
| #include "./common/SysCall.h" | |||||
| #if defined(UDR0) || defined(DOXYGEN) | #if defined(UDR0) || defined(DOXYGEN) | ||||
| #include "MinimumSerial.h" | |||||
| #include "./MinimumSerial.h" | |||||
| const uint16_t MIN_2X_BAUD = F_CPU/(4*(2*0XFFF + 1)) + 1; | const uint16_t MIN_2X_BAUD = F_CPU/(4*(2*0XFFF + 1)) + 1; | ||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ | ||||
| int MinimumSerial::available() { | int MinimumSerial::available() { |
| */ | */ | ||||
| #ifndef MinimumSerial_h | #ifndef MinimumSerial_h | ||||
| #define MinimumSerial_h | #define MinimumSerial_h | ||||
| #include "common/SysCall.h" | |||||
| #include "./common/SysCall.h" | |||||
| //============================================================================== | //============================================================================== | ||||
| /** | /** | ||||
| * \class MinimumSerial | * \class MinimumSerial |
| */ | */ | ||||
| #ifndef SdCard_h | #ifndef SdCard_h | ||||
| #define SdCard_h | #define SdCard_h | ||||
| #include "SdioCard.h" | |||||
| #include "SdSpiCard.h" | |||||
| #include "./SdioCard.h" | |||||
| #include "./SdSpiCard.h" | |||||
| #if HAS_SDIO_CLASS | #if HAS_SDIO_CLASS | ||||
| typedef SdCardInterface SdCard; | typedef SdCardInterface SdCard; | ||||
| #else // HAS_SDIO_CLASS | #else // HAS_SDIO_CLASS |
| * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||||
| * DEALINGS IN THE SOFTWARE. | * DEALINGS IN THE SOFTWARE. | ||||
| */ | */ | ||||
| #include "SdCardInfo.h" | |||||
| #include "./SdCardInfo.h" | |||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ | ||||
| #undef SD_CARD_ERROR | #undef SD_CARD_ERROR | ||||
| #define SD_CARD_ERROR(e, m) case SD_CARD_ERROR_##e: pr->print(F(#e)); break; | #define SD_CARD_ERROR(e, m) case SD_CARD_ERROR_##e: pr->print(F(#e)); break; |
| #ifndef SdCardInterface_h | #ifndef SdCardInterface_h | ||||
| #define SdCardInterface_h | #define SdCardInterface_h | ||||
| #include "../common/BlockDeviceInterface.h" | #include "../common/BlockDeviceInterface.h" | ||||
| #include "SdCardInfo.h" | |||||
| #include "./SdCardInfo.h" | |||||
| /** | /** | ||||
| * \class SdCardInterface | * \class SdCardInterface | ||||
| * \brief Abstract interface for an SD card. | * \brief Abstract interface for an SD card. |
| * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||||
| * DEALINGS IN THE SOFTWARE. | * DEALINGS IN THE SOFTWARE. | ||||
| */ | */ | ||||
| #include "SdSpiCard.h" | |||||
| #include "./SdSpiCard.h" | |||||
| //============================================================================== | //============================================================================== | ||||
| // Debug aids | // Debug aids | ||||
| #define DBG_PROFILE_STATS 0 | #define DBG_PROFILE_STATS 0 |
| #define SdSpiCard_h | #define SdSpiCard_h | ||||
| #include <stddef.h> | #include <stddef.h> | ||||
| #include "../common/SysCall.h" | #include "../common/SysCall.h" | ||||
| #include "SdCardInfo.h" | |||||
| #include "SdCardInterface.h" | |||||
| #include "./SdCardInfo.h" | |||||
| #include "./SdCardInterface.h" | |||||
| #include "../SpiDriver/SdSpiDriver.h" | #include "../SpiDriver/SdSpiDriver.h" | ||||
| //============================================================================== | //============================================================================== | ||||
| /** | /** |
| #ifndef SdioCard_h | #ifndef SdioCard_h | ||||
| #define SdioCard_h | #define SdioCard_h | ||||
| #include "../common/SysCall.h" | #include "../common/SysCall.h" | ||||
| #include "SdCardInterface.h" | |||||
| #include "./SdCardInterface.h" | |||||
| #define FIFO_SDIO 0 | #define FIFO_SDIO 0 | ||||
| #define DMA_SDIO 1 | #define DMA_SDIO 1 |
| * DEALINGS IN THE SOFTWARE. | * DEALINGS IN THE SOFTWARE. | ||||
| */ | */ | ||||
| #if defined(__MK64FX512__) || defined(__MK66FX1M0__) || defined(__IMXRT1062__) | #if defined(__MK64FX512__) || defined(__MK66FX1M0__) || defined(__IMXRT1062__) | ||||
| #include "SdioTeensy.h" | |||||
| #include "SdCardInfo.h" | |||||
| #include "SdioCard.h" | |||||
| #include "./SdioTeensy.h" | |||||
| #include "./SdCardInfo.h" | |||||
| #include "./SdioCard.h" | |||||
| //============================================================================== | //============================================================================== | ||||
| // limit of K66 due to errata KINETIS_K_0N65N. | // limit of K66 due to errata KINETIS_K_0N65N. | ||||
| const uint32_t MAX_SDHC_COUNT = 0XFFFF; | const uint32_t MAX_SDHC_COUNT = 0XFFFF; |
| * \file | * \file | ||||
| * \brief main SdFs include file. | * \brief main SdFs include file. | ||||
| */ | */ | ||||
| #include "common/SysCall.h" | |||||
| #include "SdCard/SdCard.h" | |||||
| #include "ExFatLib/ExFatLib.h" | |||||
| #include "FatLib/FatLib.h" | |||||
| #include "FsLib/FsLib.h" | |||||
| #include "./common/SysCall.h" | |||||
| #include "./SdCard/SdCard.h" | |||||
| #include "./ExFatLib/ExFatLib.h" | |||||
| #include "./FatLib/FatLib.h" | |||||
| #include "./FsLib/FsLib.h" | |||||
| #if INCLUDE_SDIOS | #if INCLUDE_SDIOS | ||||
| #include "sdios.h" | #include "sdios.h" | ||||
| #endif // INCLUDE_SDIOS | #endif // INCLUDE_SDIOS | ||||
| /** Select type for SdFat. */ | /** Select type for SdFat. */ | ||||
| typedef SdFat32 SdFat; | typedef SdFat32 SdFat; | ||||
| /** Select type for File. */ | /** Select type for File. */ | ||||
| #if !defined(__has_include) || !__has_include(<FS.h>) | |||||
| #if !defined(__has_include) || !__has_include(<core/FS.h>) | |||||
| typedef File32 File; | typedef File32 File; | ||||
| #endif | #endif | ||||
| /** Select type for SdBaseFile. */ | /** Select type for SdBaseFile. */ | ||||
| typedef FatFile SdBaseFile; | typedef FatFile SdBaseFile; | ||||
| #elif SDFAT_FILE_TYPE == 2 | #elif SDFAT_FILE_TYPE == 2 | ||||
| typedef SdExFat SdFat; | typedef SdExFat SdFat; | ||||
| #if !defined(__has_include) || !__has_include(<FS.h>) | |||||
| #if !defined(__has_include) || !__has_include(<core/FS.h>) | |||||
| typedef ExFile File; | typedef ExFile File; | ||||
| #endif | #endif | ||||
| typedef ExFatFile SdBaseFile; | typedef ExFatFile SdBaseFile; | ||||
| #elif SDFAT_FILE_TYPE == 3 | #elif SDFAT_FILE_TYPE == 3 | ||||
| typedef SdFs SdFat; | typedef SdFs SdFat; | ||||
| #if !defined(__has_include) || !__has_include(<FS.h>) | |||||
| #if !defined(__has_include) || !__has_include(<core/FS.h>) | |||||
| typedef FsFile File; | typedef FsFile File; | ||||
| #endif | #endif | ||||
| typedef FsBaseFile SdBaseFile; | typedef FsBaseFile SdBaseFile; |
| #define USE_BLOCK_DEVICE_INTERFACE 0 | #define USE_BLOCK_DEVICE_INTERFACE 0 | ||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ | ||||
| #if ENABLE_ARDUINO_FEATURES | #if ENABLE_ARDUINO_FEATURES | ||||
| #include "Arduino.h" | |||||
| #include <core/Arduino.h> | |||||
| #ifdef PLATFORM_ID | #ifdef PLATFORM_ID | ||||
| // Only defined if a Particle device. | // Only defined if a Particle device. | ||||
| #include "application.h" | #include "application.h" |
| typedef SdSpiArduinoDriver SdSpiDriver; | typedef SdSpiArduinoDriver SdSpiDriver; | ||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ | ||||
| #ifndef SD_USE_CUSTOM_SPI | #ifndef SD_USE_CUSTOM_SPI | ||||
| #include "SdSpiLibDriver.h" | |||||
| #include "./SdSpiLibDriver.h" | |||||
| #elif defined(__AVR__) | #elif defined(__AVR__) | ||||
| #include "SdSpiAvr.h" | |||||
| #include "./SdSpiAvr.h" | |||||
| #endif // __AVR__ | #endif // __AVR__ | ||||
| #endif // SdSpiArduinoDriver_h | #endif // SdSpiArduinoDriver_h |
| * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||||
| * DEALINGS IN THE SOFTWARE. | * DEALINGS IN THE SOFTWARE. | ||||
| */ | */ | ||||
| #include "SdSpiDriver.h" | |||||
| #include "./SdSpiDriver.h" | |||||
| #if defined(SD_USE_CUSTOM_SPI) && defined(ARDUINO_ARCH_APOLLO3) | #if defined(SD_USE_CUSTOM_SPI) && defined(ARDUINO_ARCH_APOLLO3) | ||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ | ||||
| void SdSpiArduinoDriver::activate() { | void SdSpiArduinoDriver::activate() { |
| * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||||
| * DEALINGS IN THE SOFTWARE. | * DEALINGS IN THE SOFTWARE. | ||||
| */ | */ | ||||
| #include "SdSpiDriver.h" | |||||
| #include "./SdSpiDriver.h" | |||||
| #if ENABLE_ARDUINO_FEATURES | #if ENABLE_ARDUINO_FEATURES | ||||
| #if SD_CHIP_SELECT_MODE == 0 | #if SD_CHIP_SELECT_MODE == 0 | ||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ |
| /** SPI bus is share with other devices. */ | /** SPI bus is share with other devices. */ | ||||
| #define SHARED_SPI 0 | #define SHARED_SPI 0 | ||||
| #if SPI_DRIVER_SELECT < 2 | #if SPI_DRIVER_SELECT < 2 | ||||
| #include "SPI.h" | |||||
| #include <spi/SPI.h> | |||||
| /** Port type for Arduino SPI hardware driver. */ | /** Port type for Arduino SPI hardware driver. */ | ||||
| typedef SPIClass SpiPort_t; | typedef SPIClass SpiPort_t; | ||||
| #elif SPI_DRIVER_SELECT == 2 | #elif SPI_DRIVER_SELECT == 2 | ||||
| SpiPort_t* spiPort; | SpiPort_t* spiPort; | ||||
| }; | }; | ||||
| #if SPI_DRIVER_SELECT < 2 | #if SPI_DRIVER_SELECT < 2 | ||||
| #include "SdSpiArduinoDriver.h" | |||||
| #include "./SdSpiArduinoDriver.h" | |||||
| #elif SPI_DRIVER_SELECT == 2 | #elif SPI_DRIVER_SELECT == 2 | ||||
| #include "SdSpiSoftDriver.h" | |||||
| #include "./SdSpiSoftDriver.h" | |||||
| #elif SPI_DRIVER_SELECT == 3 | #elif SPI_DRIVER_SELECT == 3 | ||||
| #include "SdSpiBaseClass.h" | |||||
| #include "./SdSpiBaseClass.h" | |||||
| typedef SdSpiBaseClass SdSpiDriver; | typedef SdSpiBaseClass SdSpiDriver; | ||||
| #else // SPI_DRIVER_SELECT | #else // SPI_DRIVER_SELECT | ||||
| #error Invalid SPI_DRIVER_SELECT | #error Invalid SPI_DRIVER_SELECT |
| * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||||
| * DEALINGS IN THE SOFTWARE. | * DEALINGS IN THE SOFTWARE. | ||||
| */ | */ | ||||
| #include "SdSpiDriver.h" | |||||
| #include "./SdSpiDriver.h" | |||||
| #if defined(SD_USE_CUSTOM_SPI) && defined(ARDUINO_SAM_DUE) | #if defined(SD_USE_CUSTOM_SPI) && defined(ARDUINO_SAM_DUE) | ||||
| /* Use SAM3X DMAC if nonzero */ | /* Use SAM3X DMAC if nonzero */ | ||||
| #define USE_SAM3X_DMAC 1 | #define USE_SAM3X_DMAC 1 |
| * DEALINGS IN THE SOFTWARE. | * DEALINGS IN THE SOFTWARE. | ||||
| */ | */ | ||||
| #include "SdSpiDriver.h" | |||||
| #include "./SdSpiDriver.h" | |||||
| #if defined(SD_USE_CUSTOM_SPI) && (defined(ESP8266) || defined(ESP32)) | #if defined(SD_USE_CUSTOM_SPI) && (defined(ESP8266) || defined(ESP32)) | ||||
| #define ESP_UNALIGN_OK 1 | #define ESP_UNALIGN_OK 1 | ||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ |
| * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||||
| * DEALINGS IN THE SOFTWARE. | * DEALINGS IN THE SOFTWARE. | ||||
| */ | */ | ||||
| #include "SdSpiDriver.h" | |||||
| #include "./SdSpiDriver.h" | |||||
| #if defined(SD_USE_CUSTOM_SPI) && defined(PLATFORM_ID) | #if defined(SD_USE_CUSTOM_SPI) && defined(PLATFORM_ID) | ||||
| static volatile bool SPI_DMA_TransferCompleted = false; | static volatile bool SPI_DMA_TransferCompleted = false; | ||||
| //----------------------------------------------------------------------------- | //----------------------------------------------------------------------------- |
| * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||||
| * DEALINGS IN THE SOFTWARE. | * DEALINGS IN THE SOFTWARE. | ||||
| */ | */ | ||||
| #include "SdSpiDriver.h" | |||||
| #include "./SdSpiDriver.h" | |||||
| #if defined(SD_USE_CUSTOM_SPI)\ | #if defined(SD_USE_CUSTOM_SPI)\ | ||||
| && (defined(__STM32F1__) || defined(__STM32F4__)) | && (defined(__STM32F1__) || defined(__STM32F4__)) | ||||
| #if defined(__STM32F1__) | #if defined(__STM32F1__) |
| * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||||
| * DEALINGS IN THE SOFTWARE. | * DEALINGS IN THE SOFTWARE. | ||||
| */ | */ | ||||
| #include "SdSpiDriver.h" | |||||
| #include "./SdSpiDriver.h" | |||||
| #if defined(SD_USE_CUSTOM_SPI) && defined(__arm__) && defined(CORE_TEENSY) | #if defined(SD_USE_CUSTOM_SPI) && defined(__arm__) && defined(CORE_TEENSY) | ||||
| #define USE_BLOCK_TRANSFER 1 | #define USE_BLOCK_TRANSFER 1 | ||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ |
| */ | */ | ||||
| #ifndef BlockDevice_h | #ifndef BlockDevice_h | ||||
| #define BlockDevice_h | #define BlockDevice_h | ||||
| #include "SdCard/SdCard.h" | |||||
| #include "../SdCard/SdCard.h" | |||||
| #if HAS_SDIO_CLASS || USE_BLOCK_DEVICE_INTERFACE | #if HAS_SDIO_CLASS || USE_BLOCK_DEVICE_INTERFACE | ||||
| typedef BlockDeviceInterface BlockDevice; | typedef BlockDeviceInterface BlockDevice; | ||||
| #else | #else |
| #define USE_DBG_MACROS 0 | #define USE_DBG_MACROS 0 | ||||
| #if USE_DBG_MACROS | #if USE_DBG_MACROS | ||||
| #include "Arduino.h" | |||||
| #include <core/Arduino.h> | |||||
| #ifndef DBG_FILE | #ifndef DBG_FILE | ||||
| #error DBG_FILE not defined | #error DBG_FILE not defined | ||||
| #endif // DBG_FILE | #endif // DBG_FILE |
| * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||||
| * DEALINGS IN THE SOFTWARE. | * DEALINGS IN THE SOFTWARE. | ||||
| */ | */ | ||||
| #include "FmtNumber.h" | |||||
| #include "./FmtNumber.h" | |||||
| // always use fmtBase10() - seems fast even on teensy 3.6. | // always use fmtBase10() - seems fast even on teensy 3.6. | ||||
| #define USE_FMT_BASE10 1 | #define USE_FMT_BASE10 1 | ||||
| * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||||
| * DEALINGS IN THE SOFTWARE. | * DEALINGS IN THE SOFTWARE. | ||||
| */ | */ | ||||
| #include "SysCall.h" | |||||
| #include "FsDateTime.h" | |||||
| #include "FmtNumber.h" | |||||
| #include "./SysCall.h" | |||||
| #include "./FsDateTime.h" | |||||
| #include "./FmtNumber.h" | |||||
| static void dateTimeMs10(uint16_t* date, uint16_t* time, uint8_t* ms10) { | static void dateTimeMs10(uint16_t* date, uint16_t* time, uint8_t* ms10) { | ||||
| *ms10 = 0; | *ms10 = 0; |
| #ifndef FsDateTime_h | #ifndef FsDateTime_h | ||||
| #define FsDateTime_h | #define FsDateTime_h | ||||
| #include <stdint.h> | #include <stdint.h> | ||||
| #include "SysCall.h" | |||||
| #include "./SysCall.h" | |||||
| /** Backward compatible definition. */ | /** Backward compatible definition. */ | ||||
| #define FAT_DATE(y, m, d) FS_DATE(y, m, d) | #define FAT_DATE(y, m, d) FS_DATE(y, m, d) | ||||
| * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||||
| * DEALINGS IN THE SOFTWARE. | * DEALINGS IN THE SOFTWARE. | ||||
| */ | */ | ||||
| #include "FsStructs.h" | |||||
| #include "./FsStructs.h" | |||||
| // bgnLba = relSector; | // bgnLba = relSector; | ||||
| // endLba = relSector + partSize - 1; | // endLba = relSector + partSize - 1; | ||||
| void lbaToMbrChs(uint8_t* chs, uint32_t capacityMB, uint32_t lba) { | void lbaToMbrChs(uint8_t* chs, uint32_t capacityMB, uint32_t lba) { |
| * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||||
| * DEALINGS IN THE SOFTWARE. | * DEALINGS IN THE SOFTWARE. | ||||
| */ | */ | ||||
| #include "PrintBasic.h" | |||||
| #include "./PrintBasic.h" | |||||
| #include <math.h> | #include <math.h> | ||||
| size_t PrintBasic::print(long n, uint8_t base) { | size_t PrintBasic::print(long n, uint8_t base) { |
| * \brief templates for printf | * \brief templates for printf | ||||
| */ | */ | ||||
| #include <stdarg.h> | #include <stdarg.h> | ||||
| #include "FmtNumber.h" | |||||
| #include "./FmtNumber.h" | |||||
| /** test for digit */ | /** test for digit */ | ||||
| #define isDigit(d) ('0' <= (d) && (d) <= '9') | #define isDigit(d) ('0' <= (d) && (d) <= '9') | ||||
| /** control for supported floating formats */ | /** control for supported floating formats */ |
| #endif // defined(PLATFORM_ID) | #endif // defined(PLATFORM_ID) | ||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ | ||||
| #else // ENABLE_ARDUINO_FEATURES | #else // ENABLE_ARDUINO_FEATURES | ||||
| #include "PrintBasic.h" | |||||
| #include "./PrintBasic.h" | |||||
| /** If not Arduino */ | /** If not Arduino */ | ||||
| typedef PrintBasic print_t; | typedef PrintBasic print_t; | ||||
| /** If not Arduino */ | /** If not Arduino */ |
| * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||||
| * DEALINGS IN THE SOFTWARE. | * DEALINGS IN THE SOFTWARE. | ||||
| */ | */ | ||||
| #include "SysCall.h" | |||||
| #include "./SysCall.h" | |||||
| #if 0 // defined(__AVR_ATmega328P__) && !ENABLE_ARDUINO_FEATURES | #if 0 // defined(__AVR_ATmega328P__) && !ENABLE_ARDUINO_FEATURES | ||||
| #include <avr/interrupt.h> | #include <avr/interrupt.h> | ||||
| * \file | * \file | ||||
| * \brief ArduinoInStream and ArduinoOutStream classes | * \brief ArduinoInStream and ArduinoOutStream classes | ||||
| */ | */ | ||||
| #include "SdFatConfig.h" | |||||
| #include "bufstream.h" | |||||
| #include "./SdFatConfig.h" | |||||
| #include "./bufstream.h" | |||||
| //============================================================================== | //============================================================================== | ||||
| /** | /** | ||||
| * \class ArduinoInStream | * \class ArduinoInStream |
| * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||||
| * DEALINGS IN THE SOFTWARE. | * DEALINGS IN THE SOFTWARE. | ||||
| */ | */ | ||||
| #include "StdioStream.h" | |||||
| #include "./StdioStream.h" | |||||
| #include "../common/FmtNumber.h" | #include "../common/FmtNumber.h" | ||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ | ||||
| int StdioStream::fclose() { | int StdioStream::fclose() { |
| * \brief StdioStream class | * \brief StdioStream class | ||||
| */ | */ | ||||
| #include <limits.h> | #include <limits.h> | ||||
| #include "ios.h" | |||||
| #include "./ios.h" | |||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ | ||||
| /** Total size of stream buffer. The entire buffer is used for output. | /** Total size of stream buffer. The entire buffer is used for output. | ||||
| * During input UNGETC_BUF_SIZE of this space is reserved for ungetc. | * During input UNGETC_BUF_SIZE of this space is reserved for ungetc. |
| * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||||
| * DEALINGS IN THE SOFTWARE. | * DEALINGS IN THE SOFTWARE. | ||||
| */ | */ | ||||
| #include "fstream.h" | |||||
| #include "./fstream.h" | |||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ | ||||
| int16_t StreamBaseClass::getch() { | int16_t StreamBaseClass::getch() { | ||||
| uint8_t c; | uint8_t c; |
| * \brief \ref ibufstream and \ref obufstream classes | * \brief \ref ibufstream and \ref obufstream classes | ||||
| */ | */ | ||||
| #include <string.h> | #include <string.h> | ||||
| #include "iostream.h" | |||||
| #include "./iostream.h" | |||||
| //============================================================================== | //============================================================================== | ||||
| /** | /** | ||||
| * \class ibufstream | * \class ibufstream |
| /** | /** | ||||
| * \file | * \file | ||||
| * \brief iostreams for files. | * \brief iostreams for files. | ||||
| */ | |||||
| */ | |||||
| #ifndef fstream_h | #ifndef fstream_h | ||||
| #define fstream_h | #define fstream_h | ||||
| #include "iostream.h" | |||||
| #include "./iostream.h" | |||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ | ||||
| /** | /** | ||||
| * \class StreamBaseClass | * \class StreamBaseClass |
| * \file | * \file | ||||
| * \brief \ref iostream class | * \brief \ref iostream class | ||||
| */ | */ | ||||
| #include "istream.h" | |||||
| #include "ostream.h" | |||||
| #include "./istream.h" | |||||
| #include "./ostream.h" | |||||
| /** Skip white space | /** Skip white space | ||||
| * \param[in] is the Stream | * \param[in] is the Stream | ||||
| * \return The stream | * \return The stream |
| */ | */ | ||||
| #include <float.h> | #include <float.h> | ||||
| #include <ctype.h> | #include <ctype.h> | ||||
| #include "istream.h" | |||||
| #include "./istream.h" | |||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ | ||||
| int istream::get() { | int istream::get() { | ||||
| int c; | int c; |
| * \file | * \file | ||||
| * \brief \ref istream class | * \brief \ref istream class | ||||
| */ | */ | ||||
| #include "ios.h" | |||||
| #include "./ios.h" | |||||
| /** | /** | ||||
| * \class istream | * \class istream |
| * DEALINGS IN THE SOFTWARE. | * DEALINGS IN THE SOFTWARE. | ||||
| */ | */ | ||||
| #include <string.h> | #include <string.h> | ||||
| #include "ostream.h" | |||||
| #include "./ostream.h" | |||||
| #ifndef PSTR | #ifndef PSTR | ||||
| #define PSTR(x) x | #define PSTR(x) x | ||||
| #endif // PSTR | #endif // PSTR |
| * \file | * \file | ||||
| * \brief \ref ostream class | * \brief \ref ostream class | ||||
| */ | */ | ||||
| #include "ios.h" | |||||
| #include "./ios.h" | |||||
| //============================================================================== | //============================================================================== | ||||
| /** | /** | ||||
| * \class ostream | * \class ostream |
| * \file | * \file | ||||
| * \brief C++ IO Streams features. | * \brief C++ IO Streams features. | ||||
| */ | */ | ||||
| #include "iostream/ArduinoStream.h" | |||||
| #include "iostream/fstream.h" | |||||
| #include "iostream/StdioStream.h" | |||||
| #include "./iostream/ArduinoStream.h" | |||||
| #include "./iostream/fstream.h" | |||||
| #include "./iostream/StdioStream.h" | |||||
| #endif // sdios_h | #endif // sdios_h |