File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Expand file tree Collapse file tree 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)
3434 : FS(impl), _card(NULL )
3535{}
3636
37- bool  SDMMCFS::begin (const  char  * mountpoint)
37+ bool  SDMMCFS::begin (const  char  * mountpoint,  bool  mode1bit )
3838{
3939 if (_card) {
4040 return  true ;
@@ -43,7 +43,12 @@ bool SDMMCFS::begin(const char * mountpoint)
4343 sdmmc_slot_config_t  slot_config = SDMMC_SLOT_CONFIG_DEFAULT ();
4444 sdmmc_host_t  host = SDMMC_HOST_DEFAULT ();
4545 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+  }
4752
4853 esp_vfs_fat_sdmmc_mount_config_t  mount_config = {
4954 .format_if_mount_failed  = false ,
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ class SDMMCFS : public FS
2828
2929public: 
3030 SDMMCFS (FSImplPtr impl);
31-  bool  begin (const  char  * mountpoint=" /sdcard"  );
31+  bool  begin (const  char  * mountpoint=" /sdcard" ,  bool  mode1bit= false );
3232 void  end ();
3333 sdcard_type_t  cardType ();
3434 uint64_t  cardSize ();
Original file line number Diff line number Diff line change @@ -25,4 +25,6 @@ static const uint8_t MOSI = 2;
2525static  const  uint8_t  MISO  =  15 ;
2626static  const  uint8_t  SCK  =  14 ;
2727
28+ #define  BOARD_HAS_1BIT_SDMMC 
29+ 
2830#endif  /* Pins_Arduino_h */ 
                                 You can’t perform that action at this time. 
               
                  
0 commit comments