Skip to content

Commit d699b03

Browse files
committed
Add SDIIO Pins customization as suggested by @liqijian101
Fixes #808
1 parent 70fa368 commit d699b03

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

esp3d/src/include/pins.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,31 @@
386386
//Pins for the support of SD Card Reader
387387
//-1 means use default pins of your board defined core
388388
//this are overwrited if defined in configuration.h or myconfig.h
389+
390+
#ifndef ESP_SDIO_CLK_PIN
391+
#define ESP_SDIO_CLK_PIN -1
392+
#endif // ESP_SDIO_CLK_PIN
393+
394+
#ifndef ESP_SDIO_CMD_PIN
395+
#define ESP_SDIO_CMD_PIN -1
396+
#endif // ESP_SDIO_CMD_PIN
397+
398+
#ifndef ESP_SDIO_D0_PIN
399+
#define ESP_SDIO_D0_PIN -1
400+
#endif //ESP_SDIO_D0_PIN
401+
402+
#ifndef ESP_SDIO_D1_PIN
403+
#define ESP_SDIO_D1_PIN -1
404+
#endif //ESP_SDIO_D1_PIN
405+
406+
#ifndef ESP_SDIO_D2_PIN
407+
#define ESP_SDIO_D2_PIN -1
408+
#endif //ESP_SDIO_D2_PIN
409+
410+
#ifndef ESP_SDIO_D3_PIN
411+
#define ESP_SDIO_D3_PIN -1
412+
#endif //ESP_SDIO_D3_PIN
413+
389414
#ifndef ESP_SD_CS_PIN
390415
#define ESP_SD_CS_PIN -1
391416
#endif //ESP_SD_CS_PIN

esp3d/src/include/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#define _VERSION_ESP3D_H
2323

2424
//version and sources location
25-
#define FW_VERSION "3.0.0.a213"
25+
#define FW_VERSION "3.0.0.a214"
2626
#define REPOSITORY "https://github.com/luc-github/ESP3D/tree/3.0"
2727

2828
#endif //_VERSION_ESP3D_H

esp3d/src/modules/filesystem/sd/sdio_esp32.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ uint8_t ESP_SD::getState(bool refresh)
101101

102102
bool ESP_SD::begin()
103103
{
104+
#if (ESP_SDIO_CLK_PIN != -1) || (ESP_SDIO_CMD_PIN != -1) || (ESP_SDIO_D0_PIN != -1) || (ESP_SDIO_D1_PIN != -1) || (ESP_SDIO_D2_PIN != -1) || (ESP_SDIO_D3_PIN != -1)
105+
SD_MMC.setPins(ESP_SDIO_CLK_PIN, ESP_SDIO_CMD_PIN, ESP_SDIO_D0_PIN, ESP_SDIO_D1_PIN, ESP_SDIO_D2_PIN, ESP_SDIO_D3_PIN)
106+
#endif //(ESP_SDIO_CLK_PIN != -1)
104107
log_esp3d("Begin SDIO");
105108
_started = true;
106109
#ifdef SDMMC_FORCE_BEGIN

0 commit comments

Comments
 (0)