33//
44// The maximum data rate will depend on the quality of your SD,
55// the size of the FIFO, and using dedicated SPI.
6+ #define DISABLE_FS_H_WARNING // Disable warning for type File not defined.
7+ #include " SdFat.h"
68#include " ExFatLogger.h"
79#include " FreeStack.h"
8- #include " SdFat.h"
910// ------------------------------------------------------------------------------
1011// This example was designed for exFAT but will support FAT16/FAT32.
1112// Note: Uno will not support SD_FAT_TYPE = 3.
@@ -69,13 +70,16 @@ const uint32_t PREALLOCATE_SIZE_MiB = 1024UL;
6970#define SPI_CLOCK SD_SCK_MHZ (50 )
7071
7172// Try to select the best SD card configuration.
72- #if HAS_SDIO_CLASS
73+ #if defined(HAS_TEENSY_SDIO)
7374#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)
7478#elif ENABLE_DEDICATED_SPI
7579#define SD_CONFIG SdSpiConfig (SD_CS_PIN, DEDICATED_SPI, SPI_CLOCK)
76- #else // HAS_SDIO_CLASS
80+ #else // HAS_TEENSY_SDIO
7781#define SD_CONFIG SdSpiConfig (SD_CS_PIN, SHARED_SPI, SPI_CLOCK)
78- #endif // HAS_SDIO_CLASS
82+ #endif // HAS_TEENSY_SDIO
7983
8084// Save SRAM if 328.
8185#ifdef __AVR_ATmega328P__
@@ -92,7 +96,7 @@ void logRecord(data_t* data, uint16_t overrun) {
9296 data->adc [0 ] = 0X8000 | overrun;
9397 } else {
9498 for (size_t i = 0 ; i < ADC_COUNT; i++) {
95- data->adc [i] = analogRead (i);
99+ data->adc [i] = analogRead (A0 + i);
96100 }
97101 }
98102}
0 commit comments