Add SDIIO Pins customization as suggested by @liqijian101

Fixes https://github.com/luc-github/ESP3D/issues/808
This commit is contained in:
Luc 2022-09-07 09:45:19 +08:00
parent 70fa36837a
commit d699b035ba
3 changed files with 29 additions and 1 deletions

View File

@ -386,6 +386,31 @@
//Pins for the support of SD Card Reader
//-1 means use default pins of your board defined core
//this are overwrited if defined in configuration.h or myconfig.h
#ifndef ESP_SDIO_CLK_PIN
#define ESP_SDIO_CLK_PIN -1
#endif // ESP_SDIO_CLK_PIN
#ifndef ESP_SDIO_CMD_PIN
#define ESP_SDIO_CMD_PIN -1
#endif // ESP_SDIO_CMD_PIN
#ifndef ESP_SDIO_D0_PIN
#define ESP_SDIO_D0_PIN -1
#endif //ESP_SDIO_D0_PIN
#ifndef ESP_SDIO_D1_PIN
#define ESP_SDIO_D1_PIN -1
#endif //ESP_SDIO_D1_PIN
#ifndef ESP_SDIO_D2_PIN
#define ESP_SDIO_D2_PIN -1
#endif //ESP_SDIO_D2_PIN
#ifndef ESP_SDIO_D3_PIN
#define ESP_SDIO_D3_PIN -1
#endif //ESP_SDIO_D3_PIN
#ifndef ESP_SD_CS_PIN
#define ESP_SD_CS_PIN -1
#endif //ESP_SD_CS_PIN

View File

@ -22,7 +22,7 @@
#define _VERSION_ESP3D_H
//version and sources location
#define FW_VERSION "3.0.0.a213"
#define FW_VERSION "3.0.0.a214"
#define REPOSITORY "https://github.com/luc-github/ESP3D/tree/3.0"
#endif //_VERSION_ESP3D_H

View File

@ -101,6 +101,9 @@ uint8_t ESP_SD::getState(bool refresh)
bool ESP_SD::begin()
{
#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)
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)
#endif //(ESP_SDIO_CLK_PIN != -1)
log_esp3d("Begin SDIO");
_started = true;
#ifdef SDMMC_FORCE_BEGIN