소스 검색

Test version for Particle mesh devices

main
Bill Greiman 6 년 전
부모
커밋
7871875f5c
100개의 변경된 파일175개의 추가작업 그리고 600개의 파일을 삭제
  1. BIN
      AnalogBinLoggerExtras/bintocsv/bintocsv.exe
  2. +17
    -52
      README.md
  3. +0
    -9
      SdFat/library.properties
  4. +0
    -35
      SdFat/src/BlockDriver.h
  5. +0
    -67
      SdFat/src/FatLib/FatApiConstants.h
  6. +0
    -33
      SdFat/src/FatLib/FatLib.h
  7. +0
    -38
      SdFat/src/FatLib/FmtNumber.h
  8. +0
    -56
      SdFat/src/FreeStack.h
  9. +0
    -62
      SdFat/src/MinimumSerial.h
  10. +0
    -121
      SdFat/src/SpiDriver/SdSpiSTM32F1.cpp
  11. +0
    -45
      SdFatTestSuite/SdFatTestSuite.h
  12. +1
    -0
      examples/#attic/AnalogLogger/AnalogLogger.ino
  13. +0
    -0
      examples/#attic/BaseExtCaseTest/BaseExtCaseTest.ino
  14. +1
    -0
      examples/#attic/HelloWorld/HelloWorld.ino
  15. +0
    -0
      examples/#attic/MiniSerial/MiniSerial.ino
  16. +0
    -0
      examples/#attic/PrintBenchmarkSD/PrintBenchmarkSD.ino
  17. +0
    -0
      examples/#attic/SD_Size/SD_Size.ino
  18. +0
    -0
      examples/#attic/SdFatSize/SdFatSize.ino
  19. +0
    -0
      examples/#attic/StreamParseInt/StreamParseInt.ino
  20. +1
    -0
      examples/#attic/append/append.ino
  21. +1
    -0
      examples/#attic/average/average.ino
  22. +0
    -0
      examples/#attic/benchSD/benchSD.ino
  23. +1
    -0
      examples/#attic/bufstream/bufstream.ino
  24. +1
    -0
      examples/#attic/cin_cout/cin_cout.ino
  25. +1
    -1
      examples/#attic/eventlog/eventlog.ino
  26. +2
    -1
      examples/#attic/fgetsRewrite/fgetsRewrite.ino
  27. +1
    -0
      examples/#attic/readlog/readlog.ino
  28. +0
    -0
      examples/#attic/readme.txt
  29. +0
    -0
      examples/AnalogBinLogger/AnalogBinLogger.h
  30. +2
    -2
      examples/AnalogBinLogger/AnalogBinLogger.ino
  31. +4
    -4
      examples/DirectoryFunctions/DirectoryFunctions.ino
  32. +3
    -3
      examples/LongFileName/LongFileName.ino
  33. +0
    -0
      examples/LongFileName/testFiles/A long name can be 255 characters.txt
  34. +0
    -0
      examples/LongFileName/testFiles/LFN,NAME.TXT
  35. +0
    -0
      examples/LongFileName/testFiles/MIXCASE.txt
  36. +0
    -0
      examples/LongFileName/testFiles/Not_8_3.txt
  37. +0
    -0
      examples/LongFileName/testFiles/OK%83.TXT
  38. +0
    -0
      examples/LongFileName/testFiles/STD_8_3.TXT
  39. +0
    -0
      examples/LongFileName/testFiles/With Blank.txt
  40. +0
    -0
      examples/LongFileName/testFiles/With.Two dots.txt
  41. +0
    -0
      examples/LongFileName/testFiles/lower.txt
  42. +0
    -0
      examples/LongFileName/testFiles/mixed.TXT
  43. +2
    -2
      examples/LowLatencyLogger/LowLatencyLogger.ino
  44. +0
    -0
      examples/LowLatencyLogger/UserFunctions.cpp
  45. +0
    -0
      examples/LowLatencyLogger/UserTypes.h
  46. +2
    -2
      examples/LowLatencyLoggerADXL345/LowLatencyLogger.ino
  47. +0
    -0
      examples/LowLatencyLoggerADXL345/LowLatencyLoggerADXL345.ino
  48. +0
    -0
      examples/LowLatencyLoggerADXL345/UserFunctions.cpp
  49. +0
    -0
      examples/LowLatencyLoggerADXL345/UserTypes.h
  50. +0
    -0
      examples/LowLatencyLoggerADXL345/readme.txt
  51. +2
    -2
      examples/LowLatencyLoggerMPU6050/LowLatencyLogger.ino
  52. +0
    -0
      examples/LowLatencyLoggerMPU6050/LowLatencyLoggerMPU6050.ino
  53. +0
    -0
      examples/LowLatencyLoggerMPU6050/UserFunctions.cpp
  54. +0
    -0
      examples/LowLatencyLoggerMPU6050/UserTypes.h
  55. +1
    -1
      examples/OpenNext/OpenNext.ino
  56. +2
    -1
      examples/PrintBenchmark/PrintBenchmark.ino
  57. +1
    -0
      examples/QuickStart/QuickStart.ino
  58. +1
    -0
      examples/RawWrite/RawWrite.ino
  59. +1
    -1
      examples/ReadCsv/ReadCsv.ino
  60. +0
    -0
      examples/ReadCsvArray/ReadCsvArray.ino
  61. +1
    -0
      examples/ReadCsvStream/ReadCsvStream.ino
  62. +0
    -0
      examples/ReadWrite/ReadWrite.ino
  63. +3
    -6
      examples/STM32Test/STM32Test.ino
  64. +1
    -0
      examples/SdFormatter/SdFormatter.ino
  65. +1
    -0
      examples/SdInfo/SdInfo.ino
  66. +1
    -1
      examples/SoftwareSpi/SoftwareSpi.ino
  67. +1
    -1
      examples/StdioBench/StdioBench.ino
  68. +0
    -0
      examples/TeensySdioDemo/TeensySdioDemo.ino
  69. +4
    -3
      examples/Timestamp/Timestamp.ino
  70. +1
    -1
      examples/TwoCards/TwoCards.ino
  71. +2
    -1
      examples/VolumeFreeSpace/VolumeFreeSpace.ino
  72. +3
    -2
      examples/bench/bench.ino
  73. +1
    -1
      examples/dataLogger/dataLogger.ino
  74. +3
    -2
      examples/fgets/fgets.ino
  75. +1
    -0
      examples/formatting/formatting.ino
  76. +1
    -0
      examples/getline/getline.ino
  77. +3
    -2
      examples/rename/rename.ino
  78. +0
    -0
      examples/wipe/wipe.ino
  79. +0
    -0
      extras/AnalogBinLoggerExtras/ADC_ENOB.PNG
  80. +0
    -0
      extras/AnalogBinLoggerExtras/ADCdocs/ATmegaADCAccuracy.pdf
  81. +0
    -0
      extras/AnalogBinLoggerExtras/ADCdocs/ExcelFFT.pdf
  82. +0
    -0
      extras/AnalogBinLoggerExtras/AdcErrorStudy.txt
  83. +0
    -0
      extras/AnalogBinLoggerExtras/DATA.png
  84. +0
    -0
      extras/AnalogBinLoggerExtras/FFT.png
  85. +0
    -0
      extras/AnalogBinLoggerExtras/RateTable.txt
  86. +0
    -0
      extras/AnalogBinLoggerExtras/bintocsv/AnalogBinLogger.h
  87. +0
    -0
      extras/AnalogBinLoggerExtras/bintocsv/bintocsv.cpp
  88. +1
    -2
      extras/AnalogBinLoggerExtras/readme.txt
  89. +26
    -22
      extras/MainPage/SdFatmainpage.h
  90. +0
    -0
      extras/SdFat.html
  91. +23
    -18
      extras/SdFatTestSuite/SdFatTestSuite.cpp
  92. +50
    -0
      extras/SdFatTestSuite/SdFatTestSuite.h
  93. +0
    -0
      extras/SdFatTestSuite/examples/ATS_SD_File/ATS_SD_File.ino
  94. +0
    -0
      extras/SdFatTestSuite/examples/ATS_SD_Files/ATS_SD_Files.ino
  95. +0
    -0
      extras/SdFatTestSuite/examples/ATS_SD_Seek/ATS_SD_Seek.ino
  96. +0
    -0
      extras/SdFatTestSuite/examples/StressTest/StressTest.ino
  97. +0
    -0
      extras/SdFatTestSuite/examples/TestMkdir/TestMkdir.ino
  98. +0
    -0
      extras/SdFatTestSuite/examples/TestRmdir/TestRmdir.ino
  99. +0
    -0
      extras/SdFatTestSuite/examples/fstreamTest/fstreamTest.ino
  100. +0
    -0
      extras/SdFatTestSuite/examples/istreamTest/istreamTest.ino

BIN
AnalogBinLoggerExtras/bintocsv/bintocsv.exe 파일 보기


+ 17
- 52
README.md 파일 보기

@@ -1,62 +1,27 @@
### Warning: This beta version is now out of date. Use standard version of SdFat.
### Warning: This beta is for testing with Particle IoT mesh devices.

Teensy 3.5/3.6 SDIO support has been added. Try the TeensySdioDemo example.
Many other example will work with Teensy SDIO if you use the SdFatSdio classes
and call begin with no parameters.
This version of SdFat has been modified to use standard POSIX/Linux
definitions of open flags from fcntl.h.

```
SdFatSdio sd;
....
if (!sd.begin()) {
// Handle failure.
}
```

Recent versions of the Arduino IDE have bugs that may cause SdFat-beta to crash.

https://forum.arduino.cc/index.php?topic=419264.0

SdFat-beta was tested using Arduino AVR boards 1.6.11.
If you are using IDE 1.6.11 you must also install AVR boards 1.6.11, not
1.6.12 or 1.6.13.

If you are using Arduino IDE 1.6.11, do Tools > Board > Boards Manager > Arduino AVR Boards > 1.6.11 > Install > Close.

Key changes:
Open flags are include access modes, O_RDONLY, O_RDWR, O_WRONLY, and modifiers
O_APPEND, O_CREAT, O_EXCL, O_SYNC, O_TRUNC.

The SPI divisor has been replaced by SPISettings.
Rename this folder SdFat and place it in the standard place for libraries.

There are two new classes, SdFatEX and SdFatSoftSpiEX.
I tested with a particle CLI project with a SdFat in a lib

Please read changes.txt and the html documentation for more information.

Please report problems as issues.

The Arduino SdFat library provides read/write access to FAT16/FAT32
file systems on SD/SDHC flash cards.

SdFat requires Arduino 1.6x or greater.

To use SdFat, unzip the download file and place the SdFat folder
into the libraries sub-folder in your main sketch folder.

For more information see the Manual installation section of this guide:
```
\Users\bill\Documents\Particle\projects\SdFatMod>ls *
README.md argon_firmware_1545324931631.bin project.properties

http://arduino.cc/en/Guide/Libraries
lib:
SdFat

A number of configuration options can be set by editing SdFatConfig.h
define macros. See the html documentation for details
src:
SdFatMod.ino
```

Read changes.txt if you have used previous releases of this library.
The mods required changing the type for open flags from uint8_t to int so
bugs are likely if any uint8_t local variables were missed.

Please read the html documentation for this library. Start with
html/index.html and read the Main Page. Next go to the Classes tab and
read the documentation for the classes SdFat, SdFatEX, SdBaseFile,
SdFile, File, StdioStream, ifstream, ofstream, and others.
Please continue by reading the html documentation.

Updated 5 Sep 2016

+ 0
- 9
SdFat/library.properties 파일 보기

@@ -1,9 +0,0 @@
name=SdFat
version=2016.7.24
author=
maintainer=
sentence=FAT16/FAT32 file system for SD cards.
paragraph=
category=Uncategorized
url=
architectures=*

+ 0
- 35
SdFat/src/BlockDriver.h 파일 보기

@@ -1,35 +0,0 @@
/* Arduino SdFat Library
* Copyright (C) 2016 by William Greiman
*
* This file is part of the Arduino SdFat Library
*
* This Library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This Library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the Arduino SdFat Library. If not, see
* <http://www.gnu.org/licenses/>.
*/
/**
* \file
* \brief Define block driver.
*/
#ifndef BlockDriver_h
#define BlockDriver_h
#include "FatLib/BaseBlockDriver.h"
#include "SdCard/SdSpiCard.h"
//-----------------------------------------------------------------------------
/** typedef for BlockDriver */
#if ENABLE_EXTENDED_TRANSFER_CLASS || ENABLE_SDIO_CLASS
typedef BaseBlockDriver BlockDriver;
#else // ENABLE_EXTENDED_TRANSFER_CLASS || ENABLE_SDIO_CLASS
typedef SdSpiCard BlockDriver;
#endif // ENABLE_EXTENDED_TRANSFER_CLASS || ENABLE_SDIO_CLASS
#endif // BlockDriver_h

+ 0
- 67
SdFat/src/FatLib/FatApiConstants.h 파일 보기

@@ -1,67 +0,0 @@
/* FatLib Library
* Copyright (C) 2013 by William Greiman
*
* This file is part of the FatLib Library
*
* This Library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This Library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the FatLib Library. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef FatApiConstants_h
#define FatApiConstants_h
//------------------------------------------------------------------------------
// use the gnu style oflag in open()
/** open() oflag for reading */
const uint8_t O_READ = 0X01;
/** open() oflag - same as O_IN */
const uint8_t O_RDONLY = O_READ;
/** open() oflag for write */
const uint8_t O_WRITE = 0X02;
/** open() oflag - same as O_WRITE */
const uint8_t O_WRONLY = O_WRITE;
/** open() oflag for reading and writing */
const uint8_t O_RDWR = (O_READ | O_WRITE);
/** open() oflag mask for access modes */
const uint8_t O_ACCMODE = (O_READ | O_WRITE);
/** The file offset shall be set to the end of the file prior to each write. */
const uint8_t O_APPEND = 0X04;
/** synchronous writes - call sync() after each write */
const uint8_t O_SYNC = 0X08;
/** truncate the file to zero length */
const uint8_t O_TRUNC = 0X10;
/** set the initial position at the end of the file */
const uint8_t O_AT_END = 0X20;
/** create the file if nonexistent */
const uint8_t O_CREAT = 0X40;
/** If O_CREAT and O_EXCL are set, open() shall fail if the file exists */
const uint8_t O_EXCL = 0X80;

// FatFile class static and const definitions
// flags for ls()
/** ls() flag for list all files including hidden. */
const uint8_t LS_A = 1;
/** ls() flag to print modify. date */
const uint8_t LS_DATE = 2;
/** ls() flag to print file size. */
const uint8_t LS_SIZE = 4;
/** ls() flag for recursive list of subdirectories */
const uint8_t LS_R = 8;

// flags for timestamp
/** set the file's last access date */
const uint8_t T_ACCESS = 1;
/** set the file's creation date and time */
const uint8_t T_CREATE = 2;
/** Set the file's write date and time */
const uint8_t T_WRITE = 4;
#endif // FatApiConstants_h

+ 0
- 33
SdFat/src/FatLib/FatLib.h 파일 보기

@@ -1,33 +0,0 @@
/* FatLib Library
* Copyright (C) 2013 by William Greiman
*
* This file is part of the FatLib Library
*
* This Library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This Library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the FatLib Library. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef FatLib_h
#define FatLib_h
#include "ArduinoFiles.h"
#include "ArduinoStream.h"
#include "FatFileSystem.h"
#include "FatLibConfig.h"
#include "FatVolume.h"
#include "FatFile.h"
#include "StdioStream.h"
#include "fstream.h"
//------------------------------------------------------------------------------
/** FatFileSystem version YYYYMMDD */
#define FAT_LIB_VERSION 20150131
#endif // FatLib_h

+ 0
- 38
SdFat/src/FatLib/FmtNumber.h 파일 보기

@@ -1,38 +0,0 @@
/* FatLib Library
* Copyright (C) 2013 by William Greiman
*
* This file is part of the FatLib Library
*
* This Library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This Library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the FatLib Library. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef FmtNumber_h
#define FmtNumber_h
// #include <ctype.h>
inline bool isDigit(char c) {
return '0' <= c && c <= '9';
}
inline bool isSpace(char c) {
return c == ' ' || (0X9 <= c && c <= 0XD);
}
#include <math.h>
#include <stdint.h>
char* fmtDec(uint16_t n, char* p);
char* fmtDec(uint32_t n, char* p);
char* fmtFloat(float value, char* p, uint8_t prec);
char* fmtFloat(float value, char* ptr, uint8_t prec, char expChar);
char* fmtHex(uint32_t n, char* p);
float scale10(float v, int8_t n);
float scanFloat(const char* str, char** ptr);
#endif // FmtNumber_h

+ 0
- 56
SdFat/src/FreeStack.h 파일 보기

@@ -1,56 +0,0 @@
/* Arduino SdFat Library
* Copyright (C) 2015 by William Greiman
*
* This file is part of the Arduino SdFat Library
*
* This Library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This Library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

* You should have received a copy of the GNU General Public License
* along with the Arduino SdFat Library. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef FreeStack_h
#define FreeStack_h
/**
* \file
* \brief FreeStack() function.
*/
#if defined(__AVR__) || defined(DOXYGEN)
/** boundary between stack and heap. */
extern char *__brkval;
/** End of bss section.*/
extern char __bss_end;
/** Amount of free stack space.
* \return The number of free bytes.
*/
static int FreeStack() {
char* sp = reinterpret_cast<char*>(SP);
return __brkval ? sp - __brkval : sp - &__bss_end;
// char top;
// return __brkval ? &top - __brkval : &top - &__bss_end;
}
#elif defined(PLATFORM_ID) // Particle board
static int FreeStack() {
return System.freeMemory();
}
#elif defined(__arm__)
extern "C" char* sbrk(int incr);
static int FreeStack() {
char top = 't';
return &top - reinterpret_cast<char*>(sbrk(0));
}
#else
#warning FreeStack is not defined for this system.
static int FreeStack() {
return 0;
}
#endif
#endif // FreeStack_h

+ 0
- 62
SdFat/src/MinimumSerial.h 파일 보기

@@ -1,62 +0,0 @@
/* Arduino SdFat Library
* Copyright (C) 2012 by William Greiman
*
* This file is part of the Arduino SdFat Library
*
* This Library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This Library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the Arduino SdFat Library. If not, see
* <http://www.gnu.org/licenses/>.
*/
/**
* \file
* \brief Minimal AVR Serial driver.
*/
#ifndef MinimumSerial_h
#define MinimumSerial_h
#include "SysCall.h"
//==============================================================================
/**
* \class MinimumSerial
* \brief mini serial class for the %SdFat library.
*/
class MinimumSerial : public Print {
public:
/** \return true for hardware serial */
operator bool() { return true; }
/**
* \return one if data is available.
*/
int available();
/**
* Set baud rate for serial port zero and enable in non interrupt mode.
* Do not call this function if you use another serial library.
* \param[in] baud rate
*/
void begin(uint32_t baud);
/** Wait for write done. */
void flush();
/**
* Unbuffered read
* \return -1 if no character is available or an available character.
*/
int read();
/**
* Unbuffered write
*
* \param[in] b byte to write.
* \return 1
*/
size_t write(uint8_t b);
using Print::write;
};
#endif // MinimumSerial_h

+ 0
- 121
SdFat/src/SpiDriver/SdSpiSTM32F1.cpp 파일 보기

@@ -1,121 +0,0 @@
/* Arduino SdSpiAltDriver Library
* Copyright (C) 2013 by William Greiman
*
* This file is part of the Arduino SdSpiAltDriver Library
*
* This Library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This Library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the Arduino SdSpiAltDriver Library. If not, see
* <http://www.gnu.org/licenses/>.
*/
#if defined(__STM32F1__)
#include "SdSpiDriver.h"
#define USE_STM32F1_DMAC 1
//------------------------------------------------------------------------------
static SPIClass m_SPI1(1);
#if BOARD_NR_SPI > 1
static SPIClass m_SPI2(2);
#endif // BOARD_NR_SPI > 1
#if BOARD_NR_SPI > 2
static SPIClass m_SPI3(3);
#endif // BOARD_NR_SPI > 2
//
static SPIClass* pSpi[] =
#if BOARD_NR_SPI == 1
{&m_SPI1};
#elif BOARD_NR_SPI == 2
{&m_SPI1, &m_SPI2};
#elif BOARD_NR_SPI == 3
{&m_SPI1, &m_SPI2, &m_SPI3};
#else // BOARD_NR_SPI
#error "BOARD_NR_SPI too large"
#endif // BOARD_NR_SPI
//------------------------------------------------------------------------------
/** Set SPI options for access to SD/SDHC cards.
*
* \param[in] divisor SCK clock divider relative to the APB1 or APB2 clock.
*/
void SdSpiAltDriver::activate() {
pSpi[m_spiPort]->beginTransaction(m_spiSettings);
}
//------------------------------------------------------------------------------
/** Initialize the SPI bus.
*
* \param[in] chipSelectPin SD card chip select pin.
*/
void SdSpiAltDriver::begin(uint8_t csPin) {
m_csPin = csPin;
pinMode(m_csPin, OUTPUT);
digitalWrite(m_csPin, HIGH);
pSpi[m_spiPort]->begin();
}
//------------------------------------------------------------------------------
/**
* End SPI transaction.
*/
void SdSpiAltDriver::deactivate() {
pSpi[m_spiPort]->endTransaction();
}
//------------------------------------------------------------------------------
/** Receive a byte.
*
* \return The byte.
*/
uint8_t SdSpiAltDriver::receive() {
return pSpi[m_spiPort]->transfer(0XFF);
}
//------------------------------------------------------------------------------
/** Receive multiple bytes.
*
* \param[out] buf Buffer to receive the data.
* \param[in] n Number of bytes to receive.
*
* \return Zero for no error or nonzero error code.
*/
uint8_t SdSpiAltDriver::receive(uint8_t* buf, size_t n) {
int rtn = 0;
#if USE_STM32F1_DMAC
rtn = pSpi[m_spiPort]->dmaTransfer(0, const_cast<uint8*>(buf), n);
#else // USE_STM32F1_DMAC
// pSpi[m_spiPort]->read(buf, n); fails ?? use byte transfer
for (size_t i = 0; i < n; i++) {
buf[i] = pSpi[m_spiPort]->transfer(0XFF);
}
#endif // USE_STM32F1_DMAC
return rtn;
}
//------------------------------------------------------------------------------
/** Send a byte.
*
* \param[in] b Byte to send
*/
void SdSpiAltDriver::send(uint8_t b) {
pSpi[m_spiPort]->transfer(b);
}
//------------------------------------------------------------------------------
/** Send multiple bytes.
*
* \param[in] buf Buffer for data to be sent.
* \param[in] n Number of bytes to send.
*/
void SdSpiAltDriver::send(const uint8_t* buf , size_t n) {
#if USE_STM32F1_DMAC
pSpi[m_spiPort]->dmaSend(const_cast<uint8*>(buf), n);
#else // #if USE_STM32F1_DMAC
pSpi[m_spiPort]->write(buf, n);
#endif // USE_STM32F1_DMAC
}
//-----------------------------------------------------------------------------
void SdSpiAltDriver::setPort(uint8_t portNumber) {
m_spiPort = portNumber < 1 || portNumber > BOARD_NR_SPI ? 0 : portNumber -1;
}
#endif // defined(__STM32F1__)

+ 0
- 45
SdFatTestSuite/SdFatTestSuite.h 파일 보기

@@ -1,45 +0,0 @@
/* Arduino SdFat Library
* Copyright (C) 2011 by William Greiman
*
* This file is part of the Arduino SdFat Library
*
* This Library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This Library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the Arduino SdFat Library. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef SdFatTestSuite_h
#define SdFatTestSuite_h
#include <SdFat.h>
#include <SdFatUtil.h>

#if defined(__arm__) && !defined(strcmp_P)
#define strcmp_P(a, b) strcmp((a), (b))
#endif // strcmp_P

#if defined(__arm__) && !defined(strncpy_P)
#define strncpy_P(s, t, n) strncpy(s, t, n)
#endif // strncpy_P

#if defined(__arm__) && !defined(strlen_P)
#define strlen_P(str) strlen(str)
#endif // strlen_P

#define testVerifyBool(result) testVerify_P(result, PSTR(#result))
#define testVerifyMsg(result, msg) testVerify_P(result, PSTR(msg))
#define testVerifyStr(result, expect) testVerify_P(result, PSTR(expect))

void testBegin();
void testEnd();
void testVerify_P(bool b, PGM_P msg);
void testVerify_P(char* result, PGM_P expect);
#endif // SdFatTestSuite_h

SdFat/examples/#attic/AnalogLogger/AnalogLogger.ino → examples/#attic/AnalogLogger/AnalogLogger.ino 파일 보기

@@ -2,6 +2,7 @@
// uses RTClib from https://github.com/adafruit/RTClib
#include <SPI.h>
#include "SdFat.h"
#include "sdios.h"
#include "FreeStack.h"

#define SD_CHIP_SELECT SS // SD chip select pin

SdFat/examples/#attic/BaseExtCaseTest/BaseExtCaseTest.ino → examples/#attic/BaseExtCaseTest/BaseExtCaseTest.ino 파일 보기


SdFat/examples/#attic/HelloWorld/HelloWorld.ino → examples/#attic/HelloWorld/HelloWorld.ino 파일 보기

@@ -1,5 +1,6 @@
#include <SPI.h>
#include "SdFat.h"
#include "sdios.h"

// create a serial output stream
ArduinoOutStream cout(Serial);

SdFat/examples/#attic/MiniSerial/MiniSerial.ino → examples/#attic/MiniSerial/MiniSerial.ino 파일 보기


SdFat/examples/#attic/PrintBenchmarkSD/PrintBenchmarkSD.ino → examples/#attic/PrintBenchmarkSD/PrintBenchmarkSD.ino 파일 보기


SdFat/examples/#attic/SD_Size/SD_Size.ino → examples/#attic/SD_Size/SD_Size.ino 파일 보기


SdFat/examples/#attic/SdFatSize/SdFatSize.ino → examples/#attic/SdFatSize/SdFatSize.ino 파일 보기


SdFat/examples/#attic/StreamParseInt/StreamParseInt.ino → examples/#attic/StreamParseInt/StreamParseInt.ino 파일 보기


SdFat/examples/#attic/append/append.ino → examples/#attic/append/append.ino 파일 보기

@@ -7,6 +7,7 @@
*/
#include <SPI.h>
#include "SdFat.h"
#include "sdios.h"

// SD chip select pin
const uint8_t chipSelect = SS;

SdFat/examples/#attic/average/average.ino → examples/#attic/average/average.ino 파일 보기

@@ -3,6 +3,7 @@
*/
#include <SPI.h>
#include "SdFat.h"
#include "sdios.h"

// SD chip select pin
const uint8_t chipSelect = SS;

SdFat/examples/#attic/benchSD/benchSD.ino → examples/#attic/benchSD/benchSD.ino 파일 보기


SdFat/examples/#attic/bufstream/bufstream.ino → examples/#attic/bufstream/bufstream.ino 파일 보기

@@ -3,6 +3,7 @@
*/
#include <SPI.h>
#include "SdFat.h"
#include "sdios.h"

// create a serial output stream
ArduinoOutStream cout(Serial);

SdFat/examples/#attic/cin_cout/cin_cout.ino → examples/#attic/cin_cout/cin_cout.ino 파일 보기

@@ -3,6 +3,7 @@
*/
#include <SPI.h>
#include "SdFat.h"
#include "sdios.h"

// create serial output stream
ArduinoOutStream cout(Serial);

SdFat/examples/#attic/eventlog/eventlog.ino → examples/#attic/eventlog/eventlog.ino 파일 보기

@@ -3,7 +3,7 @@
*/
#include <SPI.h>
#include "SdFat.h"
#include "sdios.h"
// SD chip select pin
const uint8_t chipSelect = SS;


SdFat/examples/#attic/fgetsRewrite/fgetsRewrite.ino → examples/#attic/fgetsRewrite/fgetsRewrite.ino 파일 보기

@@ -1,6 +1,7 @@
// Demo of rewriting a line read by fgets
#include <SPI.h>
#include "SdFat.h"
#include "sdios.h"

// SD card chip select pin
const uint8_t chipSelect = SS;
@@ -65,7 +66,7 @@ void demoFgets() {
//------------------------------------------------------------------------------
void makeTestFile() {
// create or open test file
SdFile wrfile("fgets.txt", O_WRITE | O_CREAT | O_TRUNC);
SdFile wrfile("fgets.txt", O_WRONLY | O_CREAT | O_TRUNC);

// check for open error
if (!wrfile.isOpen()) {

SdFat/examples/#attic/readlog/readlog.ino → examples/#attic/readlog/readlog.ino 파일 보기

@@ -4,6 +4,7 @@
*/
#include <SPI.h>
#include "SdFat.h"
#include "sdios.h"

// SD chip select pin
const uint8_t chipSelect = SS;

SdFat/examples/#attic/readme.txt → examples/#attic/readme.txt 파일 보기


SdFat/examples/AnalogBinLogger/AnalogBinLogger.h → examples/AnalogBinLogger/AnalogBinLogger.h 파일 보기


SdFat/examples/AnalogBinLogger/AnalogBinLogger.ino → examples/AnalogBinLogger/AnalogBinLogger.ino 파일 보기

@@ -436,7 +436,7 @@ void binaryToCsv() {
return;
}
binFile.rewind();
if (!binFile.read(&buf , 512) == 512) {
if (binFile.read(&buf , 512) != 512) {
error("Read metadata failed");
}
// Create a new csv file.
@@ -517,7 +517,7 @@ void checkOverrun() {
binFile.rewind();
Serial.println();
Serial.println(F("Checking overrun errors - type any character to stop"));
if (!binFile.read(&buf , 512) == 512) {
if (binFile.read(&buf , 512) != 512) {
error("Read metadata failed");
}
bn++;

SdFat/examples/directoryFunctions/directoryFunctions.ino → examples/DirectoryFunctions/DirectoryFunctions.ino 파일 보기

@@ -3,7 +3,7 @@
*/
#include <SPI.h>
#include "SdFat.h"
#include "sdios.h"
// SD card chip select pin.
const uint8_t chipSelect = SS;
//------------------------------------------------------------------------------
@@ -53,7 +53,7 @@ void setup() {

int rootFileCount = 0;
sd.vwd()->rewind();
while (file.openNext(sd.vwd(), O_READ)) {
while (file.openNext(sd.vwd(), O_RDONLY)) {
if (!file.isHidden()) {
rootFileCount++;
}
@@ -73,7 +73,7 @@ void setup() {
cout << F("Created Folder1\n");

// Create a file in Folder1 using a path.
if (!file.open("Folder1/file1.txt", O_CREAT | O_WRITE)) {
if (!file.open("Folder1/file1.txt", O_WRONLY | O_CREAT)) {
error("create Folder1/file1.txt failed");
}
file.close();
@@ -86,7 +86,7 @@ void setup() {
cout << F("chdir to Folder1\n");

// Create File2.txt in current directory.
if (!file.open("File2.txt", O_CREAT | O_WRITE)) {
if (!file.open("File2.txt", O_WRONLY | O_CREAT)) {
error("create File2.txt failed");
}
file.close();

SdFat/examples/LongFileName/LongFileName.ino → examples/LongFileName/LongFileName.ino 파일 보기

@@ -41,10 +41,10 @@ void setup() {
Serial.println();

// List files in root directory.
if (!dirFile.open("/", O_READ)) {
if (!dirFile.open("/", O_RDONLY)) {
sd.errorHalt("open root failed");
}
while (n < nMax && file.openNext(&dirFile, O_READ)) {
while (n < nMax && file.openNext(&dirFile, O_RDONLY)) {

// Skip directories and hidden files.
if (!file.isSubDir() && !file.isHidden()) {
@@ -81,7 +81,7 @@ void loop() {
return;
}
Serial.println(i);
if (!file.open(&dirFile, dirIndex[i], O_READ)) {
if (!file.open(&dirFile, dirIndex[i], O_RDONLY)) {
sd.errorHalt(F("open"));
}
Serial.println();

SdFat/examples/LongFileName/testFiles/A long name can be 255 characters.txt → examples/LongFileName/testFiles/A long name can be 255 characters.txt 파일 보기


SdFat/examples/LongFileName/testFiles/LFN,NAME.TXT → examples/LongFileName/testFiles/LFN,NAME.TXT 파일 보기


SdFat/examples/LongFileName/testFiles/MIXCASE.txt → examples/LongFileName/testFiles/MIXCASE.txt 파일 보기


SdFat/examples/LongFileName/testFiles/Not_8_3.txt → examples/LongFileName/testFiles/Not_8_3.txt 파일 보기


SdFat/examples/LongFileName/testFiles/OK%83.TXT → examples/LongFileName/testFiles/OK%83.TXT 파일 보기


SdFat/examples/LongFileName/testFiles/STD_8_3.TXT → examples/LongFileName/testFiles/STD_8_3.TXT 파일 보기


SdFat/examples/LongFileName/testFiles/With Blank.txt → examples/LongFileName/testFiles/With Blank.txt 파일 보기


SdFat/examples/LongFileName/testFiles/With.Two dots.txt → examples/LongFileName/testFiles/With.Two dots.txt 파일 보기


SdFat/examples/LongFileName/testFiles/lower.txt → examples/LongFileName/testFiles/lower.txt 파일 보기


SdFat/examples/LongFileName/testFiles/mixed.TXT → examples/LongFileName/testFiles/mixed.TXT 파일 보기


SdFat/examples/LowLatencyLogger/LowLatencyLogger.ino → examples/LowLatencyLogger/LowLatencyLogger.ino 파일 보기

@@ -197,7 +197,7 @@ void binaryToCsv() {
strcpy(csvName, binName);
strcpy(&csvName[BASE_NAME_SIZE + 3], "csv");

if (!csvFile.open(csvName, O_WRITE | O_CREAT | O_TRUNC)) {
if (!csvFile.open(csvName, O_WRONLY | O_CREAT | O_TRUNC)) {
error("open csvFile failed");
}
binFile.rewind();
@@ -338,7 +338,7 @@ void openBinFile() {
}
binFile.close();
strcpy(binName, name);
if (!binFile.open(binName, O_READ)) {
if (!binFile.open(binName, O_RDONLY)) {
Serial.println(F("open failed"));
return;
}

SdFat/examples/LowLatencyLogger/UserFunctions.cpp → examples/LowLatencyLogger/UserFunctions.cpp 파일 보기


SdFat/examples/LowLatencyLogger/UserTypes.h → examples/LowLatencyLogger/UserTypes.h 파일 보기


SdFat/examples/LowLatencyLoggerADXL345/LowLatencyLogger.ino → examples/LowLatencyLoggerADXL345/LowLatencyLogger.ino 파일 보기

@@ -197,7 +197,7 @@ void binaryToCsv() {
strcpy(csvName, binName);
strcpy(&csvName[BASE_NAME_SIZE + 3], "csv");

if (!csvFile.open(csvName, O_WRITE | O_CREAT | O_TRUNC)) {
if (!csvFile.open(csvName, O_WRONLY | O_CREAT | O_TRUNC)) {
error("open csvFile failed");
}
binFile.rewind();
@@ -338,7 +338,7 @@ void openBinFile() {
}
binFile.close();
strcpy(binName, name);
if (!binFile.open(binName, O_READ)) {
if (!binFile.open(binName, O_RDONLY)) {
Serial.println(F("open failed"));
return;
}

SdFat/examples/LowLatencyLoggerADXL345/LowLatencyLoggerADXL345.ino → examples/LowLatencyLoggerADXL345/LowLatencyLoggerADXL345.ino 파일 보기


SdFat/examples/LowLatencyLoggerADXL345/UserFunctions.cpp → examples/LowLatencyLoggerADXL345/UserFunctions.cpp 파일 보기


SdFat/examples/LowLatencyLoggerADXL345/UserTypes.h → examples/LowLatencyLoggerADXL345/UserTypes.h 파일 보기


SdFat/examples/LowLatencyLoggerADXL345/readme.txt → examples/LowLatencyLoggerADXL345/readme.txt 파일 보기


SdFat/examples/LowLatencyLoggerMPU6050/LowLatencyLogger.ino → examples/LowLatencyLoggerMPU6050/LowLatencyLogger.ino 파일 보기

@@ -197,7 +197,7 @@ void binaryToCsv() {
strcpy(csvName, binName);
strcpy(&csvName[BASE_NAME_SIZE + 3], "csv");

if (!csvFile.open(csvName, O_WRITE | O_CREAT | O_TRUNC)) {
if (!csvFile.open(csvName, O_WRONLY | O_CREAT | O_TRUNC)) {
error("open csvFile failed");
}
binFile.rewind();
@@ -338,7 +338,7 @@ void openBinFile() {
}
binFile.close();
strcpy(binName, name);
if (!binFile.open(binName, O_READ)) {
if (!binFile.open(binName, O_RDONLY)) {
Serial.println(F("open failed"));
return;
}

SdFat/examples/LowLatencyLoggerMPU6050/LowLatencyLoggerMPU6050.ino → examples/LowLatencyLoggerMPU6050/LowLatencyLoggerMPU6050.ino 파일 보기


SdFat/examples/LowLatencyLoggerMPU6050/UserFunctions.cpp → examples/LowLatencyLoggerMPU6050/UserFunctions.cpp 파일 보기


SdFat/examples/LowLatencyLoggerMPU6050/UserTypes.h → examples/LowLatencyLoggerMPU6050/UserTypes.h 파일 보기


SdFat/examples/OpenNext/OpenNext.ino → examples/OpenNext/OpenNext.ino 파일 보기

@@ -35,7 +35,7 @@ void setup() {
// Warning, openNext starts at the current position of sd.vwd() so a
// rewind may be neccessary in your application.
sd.vwd()->rewind();
while (file.openNext(sd.vwd(), O_READ)) {
while (file.openNext(sd.vwd(), O_RDONLY)) {
file.printFileSize(&Serial);
Serial.write(' ');
file.printModifyDateTime(&Serial);

SdFat/examples/PrintBenchmark/PrintBenchmark.ino → examples/PrintBenchmark/PrintBenchmark.ino 파일 보기

@@ -3,6 +3,7 @@
*/
#include <SPI.h>
#include "SdFat.h"
#include "sdios.h"
#include "FreeStack.h"

// SD chip select pin
@@ -64,7 +65,7 @@ void loop() {
char fileName[13] = "bench0.txt";
fileName[5] = '0' + test;
// open or create file - truncate existing file.
if (!file.open(fileName, O_CREAT | O_TRUNC | O_RDWR)) {
if (!file.open(fileName, O_RDWR | O_CREAT | O_TRUNC)) {
error("open failed");
}
maxLatency = 0;

SdFat/examples/QuickStart/QuickStart.ino → examples/QuickStart/QuickStart.ino 파일 보기

@@ -2,6 +2,7 @@
//
#include <SPI.h>
#include "SdFat.h"
#include "sdios.h"
//
// Set DISABLE_CHIP_SELECT to disable a second SPI device.
// For example, with the Ethernet shield, set DISABLE_CHIP_SELECT

SdFat/examples/RawWrite/RawWrite.ino → examples/RawWrite/RawWrite.ino 파일 보기

@@ -12,6 +12,7 @@
*/
#include <SPI.h>
#include "SdFat.h"
#include "sdios.h"
#include "FreeStack.h"

// SD chip select pin

SdFat/examples/readCSV/readCSV.ino → examples/ReadCsv/ReadCsv.ino 파일 보기

@@ -55,7 +55,7 @@ int csvReadText(File* file, char* str, size_t size, char delim) {
rtn = ch;
break;
}
if ((n+1) >= size) {
if ((n + 1) >= size) {
// string too long
rtn = -2;
n--;

SdFat/examples/ReadCsvArray/ReadCsvArray.ino → examples/ReadCsvArray/ReadCsvArray.ino 파일 보기


SdFat/examples/ReadCsvStream/ReadCsvStream.ino → examples/ReadCsvStream/ReadCsvStream.ino 파일 보기

@@ -4,6 +4,7 @@
*/
#include <SPI.h>
#include "SdFat.h"
#include "sdios.h"

// SD chip select pin
const uint8_t chipSelect = SS;

SdFat/examples/ReadWrite/ReadWrite.ino → examples/ReadWrite/ReadWrite.ino 파일 보기


SdFat/examples/STM32Test/STM32Test.ino → examples/STM32Test/STM32Test.ino 파일 보기

@@ -33,11 +33,7 @@ void setup() {
Serial.begin(9600);
// Wait for USB Serial
while (!Serial) {
SysCall::yield();
}
Serial.print(F("FreeStack: "));

Serial.println(FreeStack());

// fill buffer with known data
for (size_t i = 0; i < sizeof(buf); i++) {
@@ -46,8 +42,9 @@ void setup() {

Serial.println(F("type any character to start"));
while (!Serial.available()) {
SysCall::yield();
}
Serial.print(F("FreeStack: "));
Serial.println(FreeStack());

// initialize the first card
if (!sd1.begin(SD1_CS, SD_SCK_MHZ(18))) {
@@ -123,7 +120,7 @@ void setup() {

// create or open /Dir2/copy.bin and truncate it to zero length
SdFile file2;
if (!file2.open("copy.bin", O_WRITE | O_CREAT | O_TRUNC)) {
if (!file2.open("copy.bin", O_WRONLY | O_CREAT | O_TRUNC)) {
sd2.errorExit("file2");
}
Serial.println(F("Copying test.bin to copy.bin"));

SdFat/examples/SdFormatter/SdFormatter.ino → examples/SdFormatter/SdFormatter.ino 파일 보기

@@ -30,6 +30,7 @@ const uint8_t chipSelect = SS;
#define DEBUG_PRINT 0
#include <SPI.h>
#include "SdFat.h"
#include "sdios.h"
#if DEBUG_PRINT
#include "FreeStack.h"
#endif // DEBUG_PRINT

SdFat/examples/SdInfo/SdInfo.ino → examples/SdInfo/SdInfo.ino 파일 보기

@@ -3,6 +3,7 @@
*/
#include <SPI.h>
#include "SdFat.h"
#include "sdios.h"

// Set USE_SDIO to zero for SPI card access.
#define USE_SDIO 0

SdFat/examples/SoftwareSpi/SoftwareSpi.ino → examples/SoftwareSpi/SoftwareSpi.ino 파일 보기

@@ -36,7 +36,7 @@ void setup() {
sd.initErrorHalt();
}

if (!file.open("SoftSPI.txt", O_CREAT | O_RDWR)) {
if (!file.open("SoftSPI.txt", O_RDWR O _CREAT)) {
sd.errorHalt(F("open failed"));
}
file.println(F("This line was printed using software SPI."));

SdFat/examples/StdioBench/StdioBench.ino → examples/StdioBench/StdioBench.ino 파일 보기

@@ -53,7 +53,7 @@ void setup() {
for (uint8_t dataType = 0; dataType < 5; dataType++) {
for (uint8_t fileType = 0; fileType < 2; fileType++) {
if (!fileType) {
if (!printFile.open("print.txt", O_CREAT | O_RDWR | O_TRUNC)) {
if (!printFile.open("print.txt", O_RDWR | O_CREAT | O_TRUNC)) {
Serial.println(F("open fail"));
return;
}

SdFat/examples/TeensySdioDemo/TeensySdioDemo.ino → examples/TeensySdioDemo/TeensySdioDemo.ino 파일 보기


SdFat/examples/Timestamp/Timestamp.ino → examples/Timestamp/Timestamp.ino 파일 보기

@@ -4,6 +4,7 @@
*/
#include <SPI.h>
#include "SdFat.h"
#include "sdios.h"

SdFat sd;

@@ -95,7 +96,7 @@ void setup(void) {
sd.remove("stamp.txt");

// create a new file with default timestamps
if (!file.open("default.txt", O_CREAT | O_WRITE)) {
if (!file.open("default.txt", O_WRONLY | O_CREAT)) {
error("open default.txt failed");
}
cout << F("\nOpen with default times\n");
@@ -118,7 +119,7 @@ void setup(void) {
SdFile::dateTimeCallback(dateTime);

// create a new file with callback timestamps
if (!file.open("callback.txt", O_CREAT | O_WRITE)) {
if (!file.open("callback.txt", O_WRONLY | O_CREAT)) {
error("open callback.txt failed");
}
cout << ("\nOpen with callback times\n");
@@ -150,7 +151,7 @@ void setup(void) {
SdFile::dateTimeCallbackCancel();

// create a new file with default timestamps
if (!file.open("stamp.txt", O_CREAT | O_WRITE)) {
if (!file.open("stamp.txt", O_WRONLY | O_CREAT)) {
error("open stamp.txt failed");
}
// set creation date time

SdFat/examples/TwoCards/TwoCards.ino → examples/TwoCards/TwoCards.ino 파일 보기

@@ -117,7 +117,7 @@ void setup() {

// create or open /Dir2/copy.bin and truncate it to zero length
SdFile file2;
if (!file2.open("copy.bin", O_WRITE | O_CREAT | O_TRUNC)) {
if (!file2.open("copy.bin", O_WRONLY | O_CREAT | O_TRUNC)) {
sd2.errorExit("file2");
}
Serial.println(F("Copying test.bin to copy.bin"));

SdFat/examples/VolumeFreeSpace/VolumeFreeSpace.ino → examples/VolumeFreeSpace/VolumeFreeSpace.ino 파일 보기

@@ -3,6 +3,7 @@
*/
#include <SPI.h>
#include "SdFat.h"
#include "sdios.h"
/*
* SD chip select pin. Common values are:
*
@@ -61,7 +62,7 @@ void setup() {
printFreeSpace();
cout << F("Create and write to ") << TEST_FILE << endl;
if (!file.open(TEST_FILE, O_WRITE | O_CREAT)) {
if (!file.open(TEST_FILE, O_WRONLY | O_CREAT)) {
sd.errorHalt(F("Create failed"));
}
file.print(F("Cause a cluster to be allocated"));

SdFat/examples/bench/bench.ino → examples/bench/bench.ino 파일 보기

@@ -3,6 +3,7 @@
*/
#include <SPI.h>
#include "SdFat.h"
#include "sdios.h"
#include "FreeStack.h"

// Set USE_SDIO to zero for SPI card access.
@@ -130,12 +131,12 @@ void loop() {
cidDmp();

// open or create file - truncate existing file.
if (!file.open("bench.dat", O_CREAT | O_TRUNC | O_RDWR)) {
if (!file.open("bench.dat", O_RDWR | O_CREAT | O_TRUNC)) {
error("open failed");
}

// fill buf with known data
for (uint16_t i = 0; i < (BUF_SIZE-2); i++) {
for (size_t i = 0; i < (BUF_SIZE-2); i++) {
buf[i] = 'A' + (i % 26);
}
buf[BUF_SIZE-2] = '\r';

SdFat/examples/dataLogger/dataLogger.ino → examples/dataLogger/dataLogger.ino 파일 보기

@@ -99,7 +99,7 @@ void setup() {
error("Can't create file name");
}
}
if (!file.open(fileName, O_CREAT | O_WRITE | O_EXCL)) {
if (!file.open(fileName, O_WRONLY | O_CREAT | O_EXCL)) {
error("file.open");
}
// Read any Serial data.

SdFat/examples/fgets/fgets.ino → examples/fgets/fgets.ino 파일 보기

@@ -1,6 +1,7 @@
// Demo of fgets function to read lines from a file.
#include <SPI.h>
#include "SdFat.h"
#include "sdios.h"

// SD chip select pin
const uint8_t chipSelect = SS;
@@ -16,7 +17,7 @@ void demoFgets() {
char line[25];
int n;
// open test file
SdFile rdfile("fgets.txt", O_READ);
SdFile rdfile("fgets.txt", O_RDONLY);

// check for open error
if (!rdfile.isOpen()) {
@@ -40,7 +41,7 @@ void demoFgets() {
//------------------------------------------------------------------------------
void makeTestFile() {
// create or open test file
SdFile wrfile("fgets.txt", O_WRITE | O_CREAT | O_TRUNC);
SdFile wrfile("fgets.txt", O_WRONLY | O_CREAT | O_TRUNC);

// check for open error
if (!wrfile.isOpen()) {

SdFat/examples/formatting/formatting.ino → examples/formatting/formatting.ino 파일 보기

@@ -4,6 +4,7 @@
*/
#include <SPI.h>
#include "SdFat.h"
#include "sdios.h"

// create Serial stream
ArduinoOutStream cout(Serial);

SdFat/examples/getline/getline.ino → examples/getline/getline.ino 파일 보기

@@ -8,6 +8,7 @@
*/
#include <SPI.h>
#include "SdFat.h"
#include "sdios.h"

// SD chip select pin
const uint8_t chipSelect = SS;

SdFat/examples/rename/rename.ino → examples/rename/rename.ino 파일 보기

@@ -4,6 +4,7 @@
*/
#include <SPI.h>
#include "SdFat.h"
#include "sdios.h"

// SD chip select pin
const uint8_t chipSelect = SS;
@@ -45,7 +46,7 @@ void setup() {
}
}
// create a file and write one line to the file
SdFile file("Name1.txt", O_WRITE | O_CREAT);
SdFile file("Name1.txt", O_WRONLY | O_CREAT);
if (!file.isOpen()) {
error("Name1.txt");
}
@@ -91,7 +92,7 @@ void setup() {
}

// open file for append in new location and add a line
if (!file.open("dir2/DIR3/NAME3.txt", O_WRITE | O_APPEND)) {
if (!file.open("dir2/DIR3/NAME3.txt", O_WRONLY | O_APPEND)) {
error("dir2/DIR3/NAME3.txt");
}
file.println("A line for dir2/DIR3/NAME3.txt");

SdFat/examples/wipe/wipe.ino → examples/wipe/wipe.ino 파일 보기


AnalogBinLoggerExtras/ADC_ENOB.PNG → extras/AnalogBinLoggerExtras/ADC_ENOB.PNG 파일 보기


AnalogBinLoggerExtras/ADCdocs/ATmegaADCAccuracy.pdf → extras/AnalogBinLoggerExtras/ADCdocs/ATmegaADCAccuracy.pdf 파일 보기


AnalogBinLoggerExtras/ADCdocs/ExcelFFT.pdf → extras/AnalogBinLoggerExtras/ADCdocs/ExcelFFT.pdf 파일 보기


AnalogBinLoggerExtras/AdcErrorStudy.txt → extras/AnalogBinLoggerExtras/AdcErrorStudy.txt 파일 보기


AnalogBinLoggerExtras/DATA.png → extras/AnalogBinLoggerExtras/DATA.png 파일 보기


AnalogBinLoggerExtras/FFT.png → extras/AnalogBinLoggerExtras/FFT.png 파일 보기


AnalogBinLoggerExtras/RateTable.txt → extras/AnalogBinLoggerExtras/RateTable.txt 파일 보기


AnalogBinLoggerExtras/bintocsv/AnalogBinLogger.h → extras/AnalogBinLoggerExtras/bintocsv/AnalogBinLogger.h 파일 보기


AnalogBinLoggerExtras/bintocsv/bintocsv.cpp → extras/AnalogBinLoggerExtras/bintocsv/bintocsv.cpp 파일 보기


AnalogBinLoggerExtras/readme.txt → extras/AnalogBinLoggerExtras/readme.txt 파일 보기

@@ -21,8 +21,7 @@ You may need to increase the time between samples if your card has higher
latency. Using a Mega Arduino can help since it has more buffering.

The bintocsv folder contains a PC program for converting binary files to
CSV files. I have included a executable for Windows. Linux and Mac users
can build from the included source files. bintocvs is a command line program.
CSV files. Build it from the included source files. bintocvs is a command line program.

bintocsv binFile csvFile


SdFat/MainPage/SdFatmainpage.h → extras/MainPage/SdFatmainpage.h 파일 보기

@@ -1,23 +1,27 @@
/* Arduino SdFat Library
* Copyright (C) 2012 by William Greiman
/**
* Copyright (c) 20011-2017 Bill Greiman
* This file is part of the SdFat library for SD memory cards.
*
* This file is part of the Arduino SdFat Library
* MIT License
*
* This Library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* This Library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* You should have received a copy of the GNU General Public License
* along with the Arduino SdFat Library. If not, see
* <http://www.gnu.org/licenses/>.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/

/**
\mainpage Arduino %SdFat Library
<CENTER>Copyright &copy; 2012, 2013, 2014, 2015, 2016 by William Greiman
@@ -38,9 +42,9 @@ The main classes in %SdFat are SdFat, SdFatEX, SdFatSoftSpi, SdFatSoftSpiEX,
SdBaseFile, SdFile, File, StdioStream, \ref fstream, \ref ifstream,
and \ref ofstream.

The SdFat, SdFatEX, SdFatSoftSpi and SdFatSoftSpiEX classes maintain a
The SdFat, SdFatEX, SdFatSoftSpi and SdFatSoftSpiEX classes maintain a
FAT volume, a current working directory, and simplify initialization
of other classes. The SdFat and SdFatEX classes uses a fast custom hardware SPI
of other classes. The SdFat and SdFatEX classes uses a fast custom hardware SPI
implementation. The SdFatSoftSpi and SdFatSoftSpiEX classes uses software SPI.

the SdFatEX and SdFatSoftSpiEX use extended multi-block I/O for enhanced
@@ -109,7 +113,7 @@ will be defined. If the symbol ENABLE_SOFTWARE_SPI_CLASS is also nonzero,
the class SdFatSoftSpiEX will be defined.
These classes used extended multi-block SD I/O for better performance.
the SPI bus may not be shared with other devices in this mode.
Set USE_STANDARD_SPI_LIBRARY and ENABLE_SOFTWARE_SPI_CLASS to
enable various SPI options. set USE_STANDARD_SPI_LIBRARY to use the standard
Arduino SPI library. set ENABLE_SOFTWARE_SPI_CLASS to enable the SdFatSoftSpi
@@ -218,7 +222,7 @@ the bug or problem.

The two example programs QuickStart, and SdInfo are useful for troubleshooting.

A message like this from SdInfo with erorCode 0X1 indicates the SD card
A message like this from SdInfo with errorCode 0X1 indicates the SD card
is not seen by SdFat. This is often caused by a wiring error and reformatting
the card will not solve the problem.
<PRE>
@@ -236,7 +240,7 @@ Does another SPI device need to be disabled?
Is there a wiring/soldering problem?

errorCode: 0x1, errorData: 0xff
</PRE>
</PRE>
Here is a message from QuickStart that indicates a formatting problem:
<PRE>
Card successfully initialized.
@@ -284,13 +288,13 @@ Short names are always converted to upper case and their original case
value is lost. Files that have a base-name where all characters have the
same case and an extension where all characters have the same case will
display properly. Examples this type name are UPPER.low, lower.TXT,
UPPER.TXT, and lower.txt.
UPPER.TXT, and lower.txt.

An application which writes to a file using print(), println() or
write() must close the file or call sync() at the appropriate time to
force data and directory information to be written to the SD Card.

Applications must use care calling sync() sync()
Applications must use care calling sync()
since 2048 bytes of I/O is required to update file and
directory information. This includes writing the current data block, reading
the block that contains the directory entry for update, writing the directory

SdFat.html → extras/SdFat.html 파일 보기


SdFatTestSuite/SdFatTestSuite.cpp → extras/SdFatTestSuite/SdFatTestSuite.cpp 파일 보기

@@ -1,21 +1,26 @@
/* Arduino SdFat Library
* Copyright (C) 2011 by William Greiman
/**
* Copyright (c) 20011-2017 Bill Greiman
* This file is part of the SdFat library for SD memory cards.
*
* This file is part of the Arduino SdFat Library
* MIT License
*
* This Library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* This Library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* You should have received a copy of the GNU General Public License
* along with the Arduino SdFat Library. If not, see
* <http://www.gnu.org/licenses/>.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#include <SdFatTestSuite.h>
static uint16_t failCount;
@@ -36,8 +41,8 @@ void testBegin() {
while (Serial.read() <= 0) {}
delay(200); // Catch Due reset problem

testOut->print(F("FreeRam: "));
testOut->println(FreeRam());
testOut->print(F("FreeStack: "));
testOut->println(FreeStack());
testOut->println();
failCount = 0;
testCount = 0;
@@ -46,8 +51,8 @@ void testBegin() {
void testEnd() {
testOut->println();
testOut->println(F("Compiled: " __DATE__ " " __TIME__));
testOut->print(F("FreeRam: "));
testOut->println(FreeRam());
testOut->print(F("FreeStack: "));
testOut->println(FreeStack());
testOut->print(F("Test count: "));
testOut->println(testCount);
testOut->print(F("Fail count: "));

+ 50
- 0
extras/SdFatTestSuite/SdFatTestSuite.h 파일 보기

@@ -0,0 +1,50 @@
/**
* Copyright (c) 20011-2017 Bill Greiman
* This file is part of the SdFat library for SD memory cards.
*
* MIT License
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifndef SdFatTestSuite_h
#define SdFatTestSuite_h
#include "SdFat.h"
#include "FreeStack.h"

#if defined(__arm__) && !defined(strcmp_P)
#define strcmp_P(a, b) strcmp((a), (b))
#endif // strcmp_P

#if defined(__arm__) && !defined(strncpy_P)
#define strncpy_P(s, t, n) strncpy(s, t, n)
#endif // strncpy_P

#if defined(__arm__) && !defined(strlen_P)
#define strlen_P(str) strlen(str)
#endif // strlen_P

#define testVerifyBool(result) testVerify_P(result, PSTR(#result))
#define testVerifyMsg(result, msg) testVerify_P(result, PSTR(msg))
#define testVerifyStr(result, expect) testVerify_P(result, PSTR(expect))

void testBegin();
void testEnd();
void testVerify_P(bool b, PGM_P msg);
void testVerify_P(char* result, PGM_P expect);
#endif // SdFatTestSuite_h

SdFatTestSuite/examples/ATS_SD_File/ATS_SD_File.ino → extras/SdFatTestSuite/examples/ATS_SD_File/ATS_SD_File.ino 파일 보기


SdFatTestSuite/examples/ATS_SD_Files/ATS_SD_Files.ino → extras/SdFatTestSuite/examples/ATS_SD_Files/ATS_SD_Files.ino 파일 보기


SdFatTestSuite/examples/ATS_SD_Seek/ATS_SD_Seek.ino → extras/SdFatTestSuite/examples/ATS_SD_Seek/ATS_SD_Seek.ino 파일 보기


SdFatTestSuite/examples/StressTest/StressTest.ino → extras/SdFatTestSuite/examples/StressTest/StressTest.ino 파일 보기


SdFatTestSuite/examples/TestMkdir/TestMkdir.ino → extras/SdFatTestSuite/examples/TestMkdir/TestMkdir.ino 파일 보기


SdFatTestSuite/examples/TestRmdir/TestRmdir.ino → extras/SdFatTestSuite/examples/TestRmdir/TestRmdir.ino 파일 보기


SdFatTestSuite/examples/fstreamTest/fstreamTest.ino → extras/SdFatTestSuite/examples/fstreamTest/fstreamTest.ino 파일 보기


SdFatTestSuite/examples/istreamTest/istreamTest.ino → extras/SdFatTestSuite/examples/istreamTest/istreamTest.ino 파일 보기


이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.

Loading…
취소
저장