Skip to content

Commit 3fe17a8

Browse files
committed
fix(p4): Allow custom pins on P4 for ESP-Hosted
1 parent f50516a commit 3fe17a8

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

libraries/WiFi/src/WiFiGeneric.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,13 +252,23 @@ static bool wifiHostedInit() {
252252
if (!hosted_initialized) {
253253
hosted_initialized = true;
254254
struct esp_hosted_sdio_config conf = INIT_DEFAULT_HOST_SDIO_CONFIG();
255+
#ifdef BOARD_HAS_SDIO_ESP_HOSTED
256+
conf.pin_clk.pin = BOARD_SDIO_ESP_HOSTED_CLK;
257+
conf.pin_cmd.pin = BOARD_SDIO_ESP_HOSTED_CMD;
258+
conf.pin_d0.pin = BOARD_SDIO_ESP_HOSTED_D0;
259+
conf.pin_d1.pin = BOARD_SDIO_ESP_HOSTED_D1;
260+
conf.pin_d2.pin = BOARD_SDIO_ESP_HOSTED_D2;
261+
conf.pin_d3.pin = BOARD_SDIO_ESP_HOSTED_D3;
262+
conf.pin_reset.pin = BOARD_SDIO_ESP_HOSTED_RESET;
263+
#else
255264
conf.pin_clk.pin = CONFIG_ESP_SDIO_PIN_CLK;
256265
conf.pin_cmd.pin = CONFIG_ESP_SDIO_PIN_CMD;
257266
conf.pin_d0.pin = CONFIG_ESP_SDIO_PIN_D0;
258267
conf.pin_d1.pin = CONFIG_ESP_SDIO_PIN_D1;
259268
conf.pin_d2.pin = CONFIG_ESP_SDIO_PIN_D2;
260269
conf.pin_d3.pin = CONFIG_ESP_SDIO_PIN_D3;
261-
//conf.pin_rst.pin = CONFIG_ESP_SDIO_GPIO_RESET_SLAVE;
270+
conf.pin_reset.pin = CONFIG_ESP_SDIO_GPIO_RESET_SLAVE;
271+
#endif
262272
// esp_hosted_sdio_set_config() will fail on second attempt but here temporarily to not cause exception on reinit
263273
if (esp_hosted_sdio_set_config(&conf) != ESP_OK || esp_hosted_init() != ESP_OK) {
264274
log_e("esp_hosted_init failed!");

0 commit comments

Comments
 (0)