File tree 3 files changed +10
-3
lines changed
3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ SDMMCFS::SDMMCFS(FSImplPtr impl)
34
34
: FS(impl), _card(NULL )
35
35
{}
36
36
37
- bool SDMMCFS::begin (const char * mountpoint)
37
+ bool SDMMCFS::begin (const char * mountpoint, bool mode1bit )
38
38
{
39
39
if (_card) {
40
40
return true ;
@@ -43,7 +43,12 @@ bool SDMMCFS::begin(const char * mountpoint)
43
43
sdmmc_slot_config_t slot_config = SDMMC_SLOT_CONFIG_DEFAULT ();
44
44
sdmmc_host_t host = SDMMC_HOST_DEFAULT ();
45
45
host.max_freq_khz = SDMMC_FREQ_HIGHSPEED;
46
- // host.flags = SDMMC_HOST_FLAG_1BIT; //use 1-line SD mode
46
+ #ifdef BOARD_HAS_1BIT_SDMMC
47
+ mode1bit = true ;
48
+ #endif
49
+ if (mode1bit) {
50
+ host.flags = SDMMC_HOST_FLAG_1BIT; // use 1-line SD mode
51
+ }
47
52
48
53
esp_vfs_fat_sdmmc_mount_config_t mount_config = {
49
54
.format_if_mount_failed = false ,
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ class SDMMCFS : public FS
28
28
29
29
public:
30
30
SDMMCFS (FSImplPtr impl);
31
- bool begin (const char * mountpoint=" /sdcard" );
31
+ bool begin (const char * mountpoint=" /sdcard" , bool mode1bit= false );
32
32
void end ();
33
33
sdcard_type_t cardType ();
34
34
uint64_t cardSize ();
Original file line number Diff line number Diff line change @@ -25,4 +25,6 @@ static const uint8_t MOSI = 2;
25
25
static const uint8_t MISO = 15 ;
26
26
static const uint8_t SCK = 14 ;
27
27
28
+ #define BOARD_HAS_1BIT_SDMMC
29
+
28
30
#endif /* Pins_Arduino_h */
You can’t perform that action at this time.
0 commit comments