|
| 1 | +// Note: This is an old example. See the RingBufLogger example for use of |
| 2 | +// the RingBuf class. The RingBuf class can be used for text and binary data. |
| 3 | +// RingBuf can be use to log from a ISR - see the TeensyDmaAdcLogger example. |
| 4 | +// |
1 | 5 | // Example to demonstrate write latency for preallocated exFAT files. |
2 | 6 | // I suggest you write a PC program to convert very large bin files. |
3 | 7 | // |
4 | 8 | // The maximum data rate will depend on the quality of your SD, |
5 | 9 | // the size of the FIFO, and using dedicated SPI. |
6 | | -#define DISABLE_FS_H_WARNING // Disable warning for type File not defined. |
| 10 | +#ifndef DISABLE_FS_H_WARNING |
| 11 | +#define DISABLE_FS_H_WARNING // Disable warning for type File not defined. |
| 12 | +#endif // DISABLE_FS_H_WARNING |
7 | 13 | #include "SdFat.h" |
8 | | -#include "ExFatLogger.h" |
9 | 14 | #include "FreeStack.h" |
| 15 | +#include "ExFatLogger.h" |
10 | 16 | //------------------------------------------------------------------------------ |
11 | 17 | // This example was designed for exFAT but will support FAT16/FAT32. |
12 | 18 | // Note: Uno will not support SD_FAT_TYPE = 3. |
@@ -72,9 +78,9 @@ const uint32_t PREALLOCATE_SIZE_MiB = 1024UL; |
72 | 78 | // Try to select the best SD card configuration. |
73 | 79 | #if defined(HAS_TEENSY_SDIO) |
74 | 80 | #define SD_CONFIG SdioConfig(FIFO_SDIO) |
75 | | -#elif defined(RP_CLK_GPIO) && defined(RP_CMD_GPIO) && defined(RP_DAT0_GPIO) |
76 | | -// See the Rp2040SdioSetup example for RP2040/RP2350 boards. |
77 | | -#define SD_CONFIG SdioConfig(RP_CLK_GPIO, RP_CMD_GPIO, RP_DAT0_GPIO) |
| 81 | +#elif defined(HAS_BUILTIN_PIO_SDIO) |
| 82 | +// See the Rp2040SdioSetup example for boards without a builtin SDIO socket. |
| 83 | +#define SD_CONFIG SdioConfig(PIN_SD_CLK, PIN_SD_CMD_MOSI, PIN_SD_DAT0_MISO) |
78 | 84 | #elif ENABLE_DEDICATED_SPI |
79 | 85 | #define SD_CONFIG SdSpiConfig(SD_CS_PIN, DEDICATED_SPI, SPI_CLOCK) |
80 | 86 | #else // HAS_TEENSY_SDIO |
|
0 commit comments