diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 00000000..de5a6460 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,92 @@ +name: Bug Report +description: Report a problem +labels: 'Bug' +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! + It's okay to leave some blank if it doesn't apply to your problem. + + - type: dropdown + attributes: + label: Operating System + options: + - Linux + - MacOS + - RaspberryPi OS + - Windows 7 + - Windows 10 + - Windows 11 + - Others + validations: + required: true + + - type: input + attributes: + label: IDE version + placeholder: e.g Arduino 1.8.15 + validations: + required: true + + - type: input + attributes: + label: Board + placeholder: e.g Feather nRF52840 Express + validations: + required: true + + - type: input + attributes: + label: BSP version + description: Can be found under "Board Manager" menu + validations: + required: true + + - type: input + attributes: + label: SPIFlash Library version + placeholder: "Release version or github latest" + validations: + required: true + + - type: textarea + attributes: + label: Sketch + placeholder: | + e.g examples/flash_info + If it is custom sketch, please provide links to your minimal sources or as attached files. + validations: + required: true + + - type: textarea + attributes: + label: What happened ? + placeholder: A clear and concise description of what the bug is. + validations: + required: true + + - type: textarea + attributes: + label: How to reproduce ? + placeholder: | + 1. Go to '...' + 2. Click on '....' + 3. See error + validations: + required: true + + - type: textarea + attributes: + label: Debug Log + placeholder: | + Debug log where the issue occurred as attached txt file, best with comments to explain the actual events. + validations: + required: false + + - type: textarea + attributes: + label: Screenshots + description: If applicable, add screenshots to help explain your problem. + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..f7a89201 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,4 @@ +contact_links: + - name: Adafruit Support Forum + url: https://forums.adafruit.com + about: If you have other questions or need help, post it here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..e74cb57f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: Feature +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/workflows/githubci.yml b/.github/workflows/githubci.yml new file mode 100644 index 00000000..5afa8e8d --- /dev/null +++ b/.github/workflows/githubci.yml @@ -0,0 +1,41 @@ +name: Build + +on: [pull_request, push, repository_dispatch] + +jobs: + build: + strategy: + fail-fast: false + matrix: + arduino-platform: + - 'feather_esp32s2' + - 'feather_esp32s3' + - 'feather_rp2040' + - 'metro_m0' + - 'metro_m4' + - 'nrf52840' + + runs-on: ubuntu-latest + steps: + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: '3.x' + + - name: Checkout code + uses: actions/checkout@v3 + + - name: Checkout adafruit/ci-arduino + uses: actions/checkout@v3 + with: + repository: adafruit/ci-arduino + path: ci + + - name: pre-install + run: bash ci/actions_install.sh + + - name: Install Libraries for building examples + run: arduino-cli lib install RTClib SD + + - name: test platforms + run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} diff --git a/examples/AvrAdcLogger/.none.test.only b/examples/AvrAdcLogger/.none.test.only new file mode 100644 index 00000000..e69de29b diff --git a/examples/BackwardCompatibility/.feather_rp2040.test.skip b/examples/BackwardCompatibility/.feather_rp2040.test.skip new file mode 100644 index 00000000..e69de29b diff --git a/examples/BufferedPrint/BufferedPrint.ino b/examples/BufferedPrint/BufferedPrint.ino index f889c1a6..8ed74e1e 100644 --- a/examples/BufferedPrint/BufferedPrint.ino +++ b/examples/BufferedPrint/BufferedPrint.ino @@ -6,7 +6,7 @@ // SD_FAT_TYPE = 0 for SdFat/File as defined in SdFatConfig.h, // 1 for FAT16/FAT32, 2 for exFAT, 3 for FAT16/FAT32 and exFAT. -#define SD_FAT_TYPE 0 +#define SD_FAT_TYPE 1 /* Change the value of SD_CS_PIN if you are using SPI and your hardware does not use the default value, SS. @@ -232,4 +232,4 @@ void setup() { } //------------------------------------------------------------------------------ void loop() { -} \ No newline at end of file +} diff --git a/examples/DirectoryFunctions/DirectoryFunctions.ino b/examples/DirectoryFunctions/DirectoryFunctions.ino index 008d1fb9..87026459 100644 --- a/examples/DirectoryFunctions/DirectoryFunctions.ino +++ b/examples/DirectoryFunctions/DirectoryFunctions.ino @@ -6,7 +6,7 @@ // SD_FAT_TYPE = 0 for SdFat/File as defined in SdFatConfig.h, // 1 for FAT16/FAT32, 2 for exFAT, 3 for FAT16/FAT32 and exFAT. -#define SD_FAT_TYPE 0 +#define SD_FAT_TYPE 1 /* Change the value of SD_CS_PIN if you are using SPI and your hardware does not use the default value, SS. diff --git a/examples/OpenNext/OpenNext.ino b/examples/OpenNext/OpenNext.ino index 6ca5426f..c99586c3 100644 --- a/examples/OpenNext/OpenNext.ino +++ b/examples/OpenNext/OpenNext.ino @@ -5,7 +5,7 @@ // SD_FAT_TYPE = 0 for SdFat/File as defined in SdFatConfig.h, // 1 for FAT16/FAT32, 2 for exFAT, 3 for FAT16/FAT32 and exFAT. -#define SD_FAT_TYPE 0 +#define SD_FAT_TYPE 1 /* Change the value of SD_CS_PIN if you are using SPI and your hardware does not use the default value, SS. @@ -102,4 +102,4 @@ void setup() { } } //------------------------------------------------------------------------------ -void loop() {} \ No newline at end of file +void loop() {} diff --git a/examples/ReadCsvFile/ReadCsvFile.ino b/examples/ReadCsvFile/ReadCsvFile.ino index efe20ab3..c836f33b 100644 --- a/examples/ReadCsvFile/ReadCsvFile.ino +++ b/examples/ReadCsvFile/ReadCsvFile.ino @@ -2,7 +2,7 @@ // SD_FAT_TYPE = 0 for SdFat/File as defined in SdFatConfig.h, // 1 for FAT16/FAT32, 2 for exFAT, 3 for FAT16/FAT32 and exFAT. -#define SD_FAT_TYPE 0 +#define SD_FAT_TYPE 1 /* Change the value of SD_CS_PIN if you are using SPI and your hardware does not use the default value, SS. diff --git a/examples/RtcTimestampTest/RtcTimestampTest.ino b/examples/RtcTimestampTest/RtcTimestampTest.ino index f18f00c6..bb53ea19 100644 --- a/examples/RtcTimestampTest/RtcTimestampTest.ino +++ b/examples/RtcTimestampTest/RtcTimestampTest.ino @@ -13,7 +13,7 @@ // SD_FAT_TYPE = 0 for SdFat/File as defined in SdFatConfig.h, // 1 for FAT16/FAT32, 2 for exFAT, 3 for FAT16/FAT32 and exFAT. -#define SD_FAT_TYPE 0 +#define SD_FAT_TYPE 1 /* Change the value of SD_CS_PIN if you are using SPI and your hardware does not use the default value, SS. @@ -233,4 +233,4 @@ void setup() { } //------------------------------------------------------------------------------ void loop() { -} \ No newline at end of file +} diff --git a/examples/SoftwareSpi/.none.test.only b/examples/SoftwareSpi/.none.test.only new file mode 100644 index 00000000..e69de29b diff --git a/examples/SoftwareSpi/SoftwareSpi.ino b/examples/SoftwareSpi/SoftwareSpi.ino index b9559658..adb24768 100644 --- a/examples/SoftwareSpi/SoftwareSpi.ino +++ b/examples/SoftwareSpi/SoftwareSpi.ino @@ -8,7 +8,7 @@ // SD_FAT_TYPE = 0 for SdFat/File as defined in SdFatConfig.h, // 1 for FAT16/FAT32, 2 for exFAT, 3 for FAT16/FAT32 and exFAT. -#define SD_FAT_TYPE 0 +#define SD_FAT_TYPE 1 // // Chip select may be constant or RAM variable. const uint8_t SD_CS_PIN = 10; @@ -77,4 +77,4 @@ void setup() { void loop() {} #else // SPI_DRIVER_SELECT #error SPI_DRIVER_SELECT must be two in SdFat/SdFatConfig.h -#endif //SPI_DRIVER_SELECT \ No newline at end of file +#endif //SPI_DRIVER_SELECT diff --git a/examples/TeensyDmaAdcLogger/.none.test.only b/examples/TeensyDmaAdcLogger/.none.test.only new file mode 100644 index 00000000..e69de29b diff --git a/examples/TeensyRtcTimestamp/.none.test.only b/examples/TeensyRtcTimestamp/.none.test.only new file mode 100644 index 00000000..e69de29b diff --git a/examples/TeensySdioDemo/.none.test.only b/examples/TeensySdioDemo/.none.test.only new file mode 100644 index 00000000..e69de29b diff --git a/examples/TeensySdioLogger/.none.test.only b/examples/TeensySdioLogger/.none.test.only new file mode 100644 index 00000000..e69de29b diff --git a/examples/UnicodeFilenames/UnicodeFilenames.ino b/examples/UnicodeFilenames/UnicodeFilenames.ino index 94d2fe7f..a3ba8899 100644 --- a/examples/UnicodeFilenames/UnicodeFilenames.ino +++ b/examples/UnicodeFilenames/UnicodeFilenames.ino @@ -13,7 +13,7 @@ const char* names[] = {u8"россиянин", u8"très élégant", u8"狗.txt", // SD_FAT_TYPE = 0 for SdFat/File as defined in SdFatConfig.h, // 1 for FAT16/FAT32, 2 for exFAT, 3 for FAT16/FAT32 and exFAT. -#define SD_FAT_TYPE 0 +#define SD_FAT_TYPE 1 // SDCARD_SS_PIN is defined for the built-in SD on some boards. #ifndef SDCARD_SS_PIN @@ -95,4 +95,4 @@ void loop() { } #else // USE_UTF8_LONG_NAMES #error USE_UTF8_LONG_NAMES must be non-zero in SdFat/src/SdFatCongfig.h -#endif // USE_UTF8_LONG_NAMES \ No newline at end of file +#endif // USE_UTF8_LONG_NAMES diff --git a/examples/UserChipSelectFunction/.none.test.only b/examples/UserChipSelectFunction/.none.test.only new file mode 100644 index 00000000..e69de29b diff --git a/examples/UserSPIDriver/.none.test.only b/examples/UserSPIDriver/.none.test.only new file mode 100644 index 00000000..e69de29b diff --git a/examples/bench/bench.ino b/examples/bench/bench.ino index e4e017bf..7341d9f9 100644 --- a/examples/bench/bench.ino +++ b/examples/bench/bench.ino @@ -7,7 +7,7 @@ // SD_FAT_TYPE = 0 for SdFat/File as defined in SdFatConfig.h, // 1 for FAT16/FAT32, 2 for exFAT, 3 for FAT16/FAT32 and exFAT. -#define SD_FAT_TYPE 0 +#define SD_FAT_TYPE 1 /* Change the value of SD_CS_PIN if you are using SPI and your hardware does not use the default value, SS. diff --git a/examples/examplesV1/#attic/MiniSerial/.none.test.only b/examples/examplesV1/#attic/MiniSerial/.none.test.only new file mode 100644 index 00000000..e69de29b diff --git a/examples/examplesV1/#attic/PrintBenchmarkSD/.feather_rp2040.test.skip b/examples/examplesV1/#attic/PrintBenchmarkSD/.feather_rp2040.test.skip new file mode 100644 index 00000000..e69de29b diff --git a/examples/examplesV1/#attic/SD_Size/.feather_rp2040.test.skip b/examples/examplesV1/#attic/SD_Size/.feather_rp2040.test.skip new file mode 100644 index 00000000..e69de29b diff --git a/examples/examplesV1/#attic/StreamParseInt/.feather_rp2040.test.skip b/examples/examplesV1/#attic/StreamParseInt/.feather_rp2040.test.skip new file mode 100644 index 00000000..e69de29b diff --git a/examples/examplesV1/#attic/benchSD/.feather_esp32s2.test.skip b/examples/examplesV1/#attic/benchSD/.feather_esp32s2.test.skip new file mode 100644 index 00000000..e69de29b diff --git a/examples/examplesV1/#attic/benchSD/.feather_esp32s3.test.skip b/examples/examplesV1/#attic/benchSD/.feather_esp32s3.test.skip new file mode 100644 index 00000000..e69de29b diff --git a/examples/examplesV1/#attic/benchSD/.feather_rp2040.test.skip b/examples/examplesV1/#attic/benchSD/.feather_rp2040.test.skip new file mode 100644 index 00000000..e69de29b diff --git a/examples/examplesV1/#attic/benchSD/benchSD.ino b/examples/examplesV1/#attic/benchSD/benchSD.ino index f0609490..a9c8fb72 100644 --- a/examples/examplesV1/#attic/benchSD/benchSD.ino +++ b/examples/examplesV1/#attic/benchSD/benchSD.ino @@ -61,7 +61,7 @@ void loop() { } // fill buf with known data - for (size_t_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'; @@ -146,4 +146,4 @@ void loop() { Serial.print(F(" usec\n\n")); Serial.print(F("Done\n\n")); file.close(); -} \ No newline at end of file +} diff --git a/examples/examplesV1/AnalogBinLogger/.none.test.only b/examples/examplesV1/AnalogBinLogger/.none.test.only new file mode 100644 index 00000000..e69de29b diff --git a/examples/examplesV1/LowLatencyLogger/.none.test.only b/examples/examplesV1/LowLatencyLogger/.none.test.only new file mode 100644 index 00000000..e69de29b diff --git a/examples/examplesV1/LowLatencyLoggerADXL345/.none.test.only b/examples/examplesV1/LowLatencyLoggerADXL345/.none.test.only new file mode 100644 index 00000000..e69de29b diff --git a/examples/examplesV1/LowLatencyLoggerMPU6050/.none.test.only b/examples/examplesV1/LowLatencyLoggerMPU6050/.none.test.only new file mode 100644 index 00000000..e69de29b diff --git a/examples/examplesV1/RawWrite/.none.test.only b/examples/examplesV1/RawWrite/.none.test.only new file mode 100644 index 00000000..e69de29b diff --git a/examples/examplesV1/ReadCsv/.feather_rp2040.test.skip b/examples/examplesV1/ReadCsv/.feather_rp2040.test.skip new file mode 100644 index 00000000..e69de29b diff --git a/examples/examplesV1/ReadCsvArray/.feather_rp2040.test.skip b/examples/examplesV1/ReadCsvArray/.feather_rp2040.test.skip new file mode 100644 index 00000000..e69de29b diff --git a/examples/examplesV1/ReadWrite/.feather_rp2040.test.skip b/examples/examplesV1/ReadWrite/.feather_rp2040.test.skip new file mode 100644 index 00000000..e69de29b diff --git a/examples/examplesV1/STM32Test/.none.test.only b/examples/examplesV1/STM32Test/.none.test.only new file mode 100644 index 00000000..e69de29b diff --git a/examples/examplesV1/VolumeFreeSpace/.none.test.only b/examples/examplesV1/VolumeFreeSpace/.none.test.only new file mode 100644 index 00000000..e69de29b diff --git a/examples/examplesV1/wipe/.none.test.only b/examples/examplesV1/wipe/.none.test.only new file mode 100644 index 00000000..e69de29b diff --git a/examples/rename/rename.ino b/examples/rename/rename.ino index aed94c5b..425bca5c 100644 --- a/examples/rename/rename.ino +++ b/examples/rename/rename.ino @@ -6,7 +6,7 @@ // SD_FAT_TYPE = 0 for SdFat/File as defined in SdFatConfig.h, // 1 for FAT16/FAT32, 2 for exFAT, 3 for FAT16/FAT32 and exFAT. -#define SD_FAT_TYPE 0 +#define SD_FAT_TYPE 1 /* Change the value of SD_CS_PIN if you are using SPI and @@ -143,4 +143,4 @@ void setup() { cout << F("Done") << endl; } -void loop() {} \ No newline at end of file +void loop() {} diff --git a/src/SdFatConfig.h b/src/SdFatConfig.h index 3c690636..19b88193 100644 --- a/src/SdFatConfig.h +++ b/src/SdFatConfig.h @@ -34,16 +34,14 @@ #endif // __AVR__ //------------- Adafruit configuration -------------// -#ifndef SDFAT_FILE_TYPE -#define SDFAT_FILE_TYPE 1 -#endif - -#ifndef USE_BLOCK_DEVICE_INTERFACE #define USE_BLOCK_DEVICE_INTERFACE 1 -#endif - -#ifndef FAT12_SUPPORT #define FAT12_SUPPORT 1 +#define SDFAT_FILE_TYPE 1 +#define USE_SPI_ARRAY_TRANSFER 1 + +// This option will take around 2K of flash, skip for AVR +#ifndef __AVR__ +#define USE_UTF8_LONG_NAMES 1 #endif // Backward-compatible define