Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/actions/deps/external/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ runs:
run: |
source $IDF_PATH/export.sh
echo >> $GITHUB_ENV "IDF_PYTHON_ENV_PATH=$IDF_PYTHON_ENV_PATH"
echo >> $GITHUB_ENV "ESP_IDF_VERSION=$ESP_IDF_VERSION"
echo >> $GITHUB_PATH "$PATH"
shell: bash

Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -421,3 +421,6 @@
[submodule "frozen/Adafruit_CircuitPython_TAS2505"]
path = frozen/Adafruit_CircuitPython_TAS2505
url = https://github.com/adafruit/Adafruit_CircuitPython_TAS2505.git
[submodule "ports/espressif/esp-hosted"]
path = ports/espressif/esp-hosted
url = https://github.com/espressif/esp-hosted-mcu.git
6 changes: 6 additions & 0 deletions ports/espressif/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ set(ENV{IDF_PATH} ${CMAKE_SOURCE_DIR}/esp-idf)
set(COMPONENTS bt driver esp_driver_dac esp_driver_gpio esp_driver_gptimer esp_driver_i2c esp_driver_i2s esp_driver_ledc esp_driver_pcnt esp_driver_rmt esp_driver_sdmmc esp_driver_spi esp_driver_touch_sens esp_driver_tsens esp_driver_uart esp_eth esp-tls esp_adc esp_adc_cal esp_event esp_netif esp_psram esp_security esp_wifi esptool_py freertos log lwip main mbedtls mdns pthread soc ulp wpa_supplicant esp-camera esp_lcd vfs esp_vfs_console esp_stdio sdmmc usb)
set(EXTRA_COMPONENT_DIRS "esp-protocols/components/mdns" "esp-camera")

if(CIRCUITPY_ESP_HOSTED)
list(APPEND EXTRA_COMPONENT_DIRS "esp-hosted")
list(APPEND COMPONENTS esp-hosted)
endif()

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
set(ENV{ESP_IDF_VERSION} "${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}")
project(circuitpython)

idf_build_set_property(__OUTPUT_SDKCONFIG 0)
22 changes: 20 additions & 2 deletions ports/espressif/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

include ../../py/circuitpy_mkenv.mk

# Keep dependency selection identical during automatic CMake reconfiguration.
export IDF_COMPONENT_MANAGER = 0

ifeq ($(IDF_TARGET),esp32s3)
BT_IDF_TARGET = esp32c3
else ifeq ($(IDF_TARGET),esp32c61)
Expand Down Expand Up @@ -261,9 +264,11 @@ endif

ifneq ($(CIRCUITPY_WIFI),0)
ifeq ($(filter $(IDF_TARGET),esp32s2 esp32p4),)
ifneq ($(CIRCUITPY_ESP_HOSTED),1)
REGISTRATION_FUNCTIONS += -u esp_coex_init_include_func
endif
endif
endif


#Debugging/Optimization
Expand Down Expand Up @@ -936,7 +941,7 @@ do-sdkconfig: $(BUILD)/esp-idf/config/sdkconfig.h
QSTR_GLOBAL_REQUIREMENTS += $(BUILD)/esp-idf/config/sdkconfig.h
$(BUILD)/esp-idf/config/sdkconfig.h: boards/$(BOARD)/sdkconfig boards/$(BOARD)/mpconfigboard.mk CMakeLists.txt | $(BUILD)/esp-idf
$(STEPECHO) "Create $@"
$(Q)env IDF_PATH=$(IDF_PATH) IDF_COMPONENT_MANAGER=0 cmake -S . -B $(BUILD)/esp-idf -DSDKCONFIG=$(BUILD)/esp-idf/sdkconfig -DSDKCONFIG_DEFAULTS="$(SDKCONFIGS)" -DCMAKE_TOOLCHAIN_FILE=$(IDF_PATH)/tools/cmake/toolchain-$(IDF_TARGET).cmake -DIDF_TARGET=$(IDF_TARGET) -GNinja
$(Q)env IDF_PATH=$(IDF_PATH) IDF_COMPONENT_MANAGER=0 cmake -S . -B $(BUILD)/esp-idf -DSDKCONFIG=$(BUILD)/esp-idf/sdkconfig -DSDKCONFIG_DEFAULTS="$(SDKCONFIGS)" -DCMAKE_TOOLCHAIN_FILE=$(IDF_PATH)/tools/cmake/toolchain-$(IDF_TARGET).cmake -DIDF_TARGET=$(IDF_TARGET) -DCIRCUITPY_ESP_HOSTED=$(CIRCUITPY_ESP_HOSTED) -GNinja
$(Q)$(PYTHON) tools/check-sdkconfig.py \
CIRCUITPY_DUALBANK=$(CIRCUITPY_DUALBANK) \
CIRCUITPY_STORAGE_EXTEND=$(CIRCUITPY_STORAGE_EXTEND) \
Expand Down Expand Up @@ -974,6 +979,7 @@ BINARY_WIFI_BLOBS = libcore.a libespnow.a libnet80211.a libpp.a libsmartconfig.a
ifneq ($(IDF_TARGET),esp32p4)
BINARY_BLOBS = esp-idf/components/esp_phy/lib/$(IDF_TARGET)/libphy.a
endif
ifneq ($(CIRCUITPY_ESP_HOSTED),1)
ifneq ($(CIRCUITPY_WIFI),0)
BINARY_BLOBS += $(addprefix esp-idf/components/esp_wifi/lib/$(IDF_TARGET)/, $(BINARY_WIFI_BLOBS))
BINARY_BLOBS += esp-idf/components/esp_coex/lib/$(IDF_TARGET)/libcoexist.a
Expand All @@ -982,6 +988,8 @@ ifneq ($(CIRCUITPY_WIFI),0)
endif
endif

endif

ifeq ($(IDF_TARGET),esp32)
BINARY_BLOBS += esp-idf/components/esp_phy/lib/$(IDF_TARGET)/librtc.a
endif
Expand Down Expand Up @@ -1037,7 +1045,17 @@ endif
# component is interface-only elsewhere, so it must not appear in the list of
# components to link.
ifneq ($(CIRCUITPY_WIFI),0)
ESP_IDF_COMPONENTS_LINK += esp_coex esp_netif esp_security esp-tls esp_wifi lwip mdns wpa_supplicant esp_phy
ESP_IDF_COMPONENTS_LINK += esp_netif esp_security esp-tls esp_wifi lwip mbedtls mdns
ifneq ($(CIRCUITPY_ESP_HOSTED),1)
ESP_IDF_COMPONENTS_LINK += esp_coex esp_phy wpa_supplicant
endif
endif
ifeq ($(CIRCUITPY_ESP_HOSTED),1)
# ESP-IDF v6.1+ has remote Wi-Fi support built into esp_wifi, so no separate
# esp_wifi_remote component is needed.
INC := -isystem esp-hosted/host/api/include -isystem esp-hosted/host $(INC)
ESP_IDF_COMPONENTS_LINK += esp-hosted esp_http_client http_parser console
REGISTRATION_FUNCTIONS += -u esp_hosted_init
endif
# mdns registers handlers on ETH_EVENT, which is defined by esp_eth. On EMAC-capable
# targets, esp_eth's compiled EMAC sources reference the esp_hal_emac symbols; that
Expand Down
24 changes: 24 additions & 0 deletions ports/espressif/boards/adafruit_metro_esp32p4/board.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2026 Limor Fried for Adafruit Industries
//
// SPDX-License-Identifier: MIT

#include "supervisor/board.h"
#include "esp_ldo_regulator.h"

static esp_ldo_channel_handle_t io_ldo;

void board_init(void) {
// Keep the rail acquired across simulated deep-sleep wakes.
if (io_ldo != NULL) {
return;
}

// The SD card and C6 control pins (GPIO39-48) require the VO4 3.3 V rail.
const esp_ldo_channel_config_t config = {
.chan_id = 4,
.voltage_mv = 3300,
};
ESP_ERROR_CHECK(esp_ldo_acquire_channel(&config, &io_ldo));
}
30 changes: 30 additions & 0 deletions ports/espressif/boards/adafruit_metro_esp32p4/mpconfigboard.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2026 Limor Fried for Adafruit Industries
//
// SPDX-License-Identifier: MIT

#pragma once

#define MICROPY_HW_BOARD_NAME "Adafruit Metro ESP32-P4"
#define MICROPY_HW_MCU_NAME "ESP32P4"

#define MICROPY_HW_NEOPIXEL (&pin_GPIO23)
#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO35)

#define DEFAULT_I2C_BUS_SCL (&pin_GPIO32)
#define DEFAULT_I2C_BUS_SDA (&pin_GPIO33)

#define DEFAULT_SPI_BUS_SCK (&pin_GPIO15)
#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO16)
#define DEFAULT_SPI_BUS_MISO (&pin_GPIO17)

#define DEFAULT_UART_BUS_RX (&pin_GPIO0)
#define DEFAULT_UART_BUS_TX (&pin_GPIO1)

// USB-C shares GPIO24/25 with the ROM USB Serial/JTAG downloader.
#define CIRCUITPY_USB_DEVICE_INSTANCE 0
#define CIRCUITPY_ESP32P4_SWAP_LSFS (1)

// USB-A is connected to the dedicated high-speed PHY.
#define CIRCUITPY_USB_HOST_INSTANCE 1
17 changes: 17 additions & 0 deletions ports/espressif/boards/adafruit_metro_esp32p4/mpconfigboard.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
USB_VID = 0x239A
USB_PID = 0x817C
USB_PRODUCT = "Adafruit Metro ESP32-P4"
USB_MANUFACTURER = "Adafruit"

IDF_TARGET = esp32p4

CIRCUITPY_USB_HOST = 1
CIRCUITPY_ESP_HOSTED = 1

CIRCUITPY_ESP_FLASH_SIZE = 16MB
CIRCUITPY_ESP_FLASH_MODE = dio
CIRCUITPY_ESP_FLASH_FREQ = 80m

CIRCUITPY_ESP_PSRAM_SIZE = 16MB
CIRCUITPY_ESP_PSRAM_MODE = hpi
CIRCUITPY_ESP_PSRAM_FREQ = 200m
81 changes: 81 additions & 0 deletions ports/espressif/boards/adafruit_metro_esp32p4/pins.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2026 Limor Fried for Adafruit Industries
//
// SPDX-License-Identifier: MIT

#include "shared-bindings/board/__init__.h"

static const mp_rom_map_elem_t board_module_globals_table[] = {
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS

{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO49) },
{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO50) },
{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO51) },
{ MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO52) },
{ MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO53) },
{ MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO54) },

{ MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO0) },
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO0) },
{ MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO1) },
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO1) },
{ MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO2) },
{ MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO3) },
{ MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO4) },
{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) },
{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) },
{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) },
{ MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO8) },
{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO9) },
{ MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO10) },
{ MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO11) },
{ MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12) },
{ MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13) },
{ MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) },

{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO15) },
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO16) },
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO17) },
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO32) },
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO33) },

{ MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO35) },
{ MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO23) },
{ MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO18) },
{ MP_ROM_QSTR(MP_QSTR_USB_HOST_DP), MP_ROM_PTR(&pin_USB_HS_DP) },
{ MP_ROM_QSTR(MP_QSTR_USB_HOST_DM), MP_ROM_PTR(&pin_USB_HS_DM) },
{ MP_ROM_QSTR(MP_QSTR_USB_HOST_POWER), MP_ROM_PTR(&pin_GPIO14) },
{ MP_ROM_QSTR(MP_QSTR_DEBUG_TX), MP_ROM_PTR(&pin_GPIO37) },
{ MP_ROM_QSTR(MP_QSTR_DEBUG_RX), MP_ROM_PTR(&pin_GPIO38) },

{ MP_ROM_QSTR(MP_QSTR_SD_CLK), MP_ROM_PTR(&pin_GPIO43) },
{ MP_ROM_QSTR(MP_QSTR_SD_CMD), MP_ROM_PTR(&pin_GPIO44) },
{ MP_ROM_QSTR(MP_QSTR_SD_DATA0), MP_ROM_PTR(&pin_GPIO39) },
{ MP_ROM_QSTR(MP_QSTR_SD_DATA1), MP_ROM_PTR(&pin_GPIO40) },
{ MP_ROM_QSTR(MP_QSTR_SD_DATA2), MP_ROM_PTR(&pin_GPIO41) },
{ MP_ROM_QSTR(MP_QSTR_SD_DATA3), MP_ROM_PTR(&pin_GPIO42) },
{ MP_ROM_QSTR(MP_QSTR_SD_CD), MP_ROM_PTR(&pin_GPIO45) },

{ MP_ROM_QSTR(MP_QSTR_C6_RX), MP_ROM_PTR(&pin_GPIO26) },
{ MP_ROM_QSTR(MP_QSTR_C6_TX), MP_ROM_PTR(&pin_GPIO27) },
{ MP_ROM_QSTR(MP_QSTR_C6_BOOT), MP_ROM_PTR(&pin_GPIO46) },
{ MP_ROM_QSTR(MP_QSTR_C6_RESET), MP_ROM_PTR(&pin_GPIO47) },
{ MP_ROM_QSTR(MP_QSTR_C6_WAKE), MP_ROM_PTR(&pin_GPIO48) },
{ MP_ROM_QSTR(MP_QSTR_C6_SDIO_CLK), MP_ROM_PTR(&pin_GPIO34) },
{ MP_ROM_QSTR(MP_QSTR_C6_SDIO_CMD), MP_ROM_PTR(&pin_GPIO36) },
{ MP_ROM_QSTR(MP_QSTR_C6_SDIO_DATA0), MP_ROM_PTR(&pin_GPIO31) },
{ MP_ROM_QSTR(MP_QSTR_C6_SDIO_DATA1), MP_ROM_PTR(&pin_GPIO30) },
{ MP_ROM_QSTR(MP_QSTR_C6_SDIO_DATA2), MP_ROM_PTR(&pin_GPIO29) },
{ MP_ROM_QSTR(MP_QSTR_C6_SDIO_DATA3), MP_ROM_PTR(&pin_GPIO28) },

{ MP_ROM_QSTR(MP_QSTR_CAMERA_RESET), MP_ROM_PTR(&pin_GPIO21) },
{ MP_ROM_QSTR(MP_QSTR_LCD_BACKLIGHT), MP_ROM_PTR(&pin_GPIO19) },
{ MP_ROM_QSTR(MP_QSTR_LCD_RESET), MP_ROM_PTR(&pin_GPIO20) },

{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
{ MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) },
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },
};
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);
25 changes: 25 additions & 0 deletions ports/espressif/boards/adafruit_metro_esp32p4/sdkconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
CONFIG_ESP32P4_SELECTS_REV_LESS_V3=y
CONFIG_ESP32P4_REV_MIN_1=y
CONFIG_ESP_WIFI_REMOTE_ENABLED=y
CONFIG_ESP_WIFI_REMOTE_LIBRARY_HOSTED=y
CONFIG_SLAVE_IDF_TARGET_ESP32C6=y
CONFIG_ESP_HOSTED_ENABLED=y
CONFIG_ESP_HOSTED_CP_TARGET_ESP32C6=y
CONFIG_ESP_HOSTED_P4_DEV_BOARD_NONE=y
CONFIG_ESP_HOSTED_SDIO_HOST_INTERFACE=y
CONFIG_ESP_HOSTED_SDIO_SLOT_1=y
CONFIG_ESP_HOSTED_SDIO_4_BIT_BUS=y
CONFIG_ESP_HOSTED_PRIV_SDIO_PIN_CLK_SLOT_1=34
CONFIG_ESP_HOSTED_PRIV_SDIO_PIN_CMD_SLOT_1=36
CONFIG_ESP_HOSTED_PRIV_SDIO_PIN_D0_SLOT_1=31
CONFIG_ESP_HOSTED_PRIV_SDIO_PIN_D1_4BIT_BUS_SLOT_1=30
CONFIG_ESP_HOSTED_PRIV_SDIO_PIN_D2_4BIT_BUS_SLOT_1=29
CONFIG_ESP_HOSTED_PRIV_SDIO_PIN_D3_4BIT_BUS_SLOT_1=28
CONFIG_ESP_HOSTED_SDIO_GPIO_RESET_SLAVE=47
CONFIG_ESP_HOSTED_SDIO_CLOCK_FREQ_KHZ=40000

# CONFIG_WIFI_RMT_NVS_ENABLED is not set

# CONFIG_ESP_WIFI_NVS_ENABLED is not set

# CONFIG_ESP32_WIFI_NVS_ENABLED is not set
27 changes: 15 additions & 12 deletions ports/espressif/common-hal/sdioio/SDCard.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ static const char *TAG = "SDCard.c";

static bool slot_in_use[2];
static bool never_reset_sdio[2] = { false, false };
static bool host_initialized = false;

static void common_hal_sdioio_sdcard_check_for_deinit(sdioio_sdcard_obj_t *self) {
if (common_hal_sdioio_sdcard_deinited(self)) {
Expand All @@ -38,9 +37,17 @@ static int check_pins(const mcu_pin_obj_t *clock, const mcu_pin_obj_t *command,
// ESP32-S3 and P4 can use any pin for any SDMMC func in either slot
// Default to SLOT_1 for SD cards
ESP_LOGI(TAG, "Using chip with CONFIG_SOC_SDMMC_USE_GPIO_MATRIX");
if (!slot_in_use[1]) {
if (!slot_in_use[1]
#ifdef CONFIG_ESP_HOSTED_SDIO_HOST_INTERFACE
&& CONFIG_ESP_HOSTED_SDIO_SLOT != 1
#endif
) {
return SDMMC_HOST_SLOT_1;
} else if (!slot_in_use[0]) {
} else if (!slot_in_use[0]
#ifdef CONFIG_ESP_HOSTED_SDIO_HOST_INTERFACE
&& CONFIG_ESP_HOSTED_SDIO_SLOT != 0
#endif
) {
return SDMMC_HOST_SLOT_0;
}
#else
Expand Down Expand Up @@ -88,6 +95,7 @@ void common_hal_sdioio_sdcard_construct(sdioio_sdcard_obj_t *self,
esp_err_t err = ESP_OK;

sdmmc_host_t host = SDMMC_HOST_DEFAULT();
host.slot = sd_slot;
host.max_freq_khz = frequency / 1000;

sdmmc_slot_config_t slot_config = SDMMC_SLOT_CONFIG_DEFAULT();
Expand Down Expand Up @@ -116,7 +124,6 @@ void common_hal_sdioio_sdcard_construct(sdioio_sdcard_obj_t *self,
if (err != ESP_OK) {
mp_raise_OSError_msg_varg(MP_ERROR_TEXT("SDIO Init Error 0x%02x"), err);
}
host_initialized = true;
}

err = sdmmc_host_init_slot(sd_slot, &slot_config);
Expand Down Expand Up @@ -254,13 +261,10 @@ void common_hal_sdioio_sdcard_deinit(sdioio_sdcard_obj_t *self) {
return;
}

sdmmc_host_deinit_slot(self->slot);
never_reset_sdio[get_slot_index(self)] = false;
slot_in_use[get_slot_index(self)] = false;

if (!slot_in_use[0] && !slot_in_use[1] && host_initialized) {
sdmmc_host_deinit();
host_initialized = false;
}

reset_pin_number(self->command);
self->command = COMMON_HAL_MCU_NO_PIN;
Expand Down Expand Up @@ -296,13 +300,12 @@ void common_hal_sdioio_sdcard_never_reset(sdioio_sdcard_obj_t *self) {
void sdioio_reset(void) {
for (size_t i = 0; i < MP_ARRAY_SIZE(slot_in_use); i++) {
if (!never_reset_sdio[i]) {
if (slot_in_use[i]) {
sdmmc_host_deinit_slot(i);
}
slot_in_use[i] = false;
}
}
if (!slot_in_use[0] && !slot_in_use[1] && host_initialized) {
sdmmc_host_deinit();
host_initialized = false;
}

return;
}
2 changes: 1 addition & 1 deletion ports/espressif/common-hal/wifi/Radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "common-hal/socketpool/__init__.h"

#include "components/esp_netif/include/esp_netif_net_stack.h"
#include "components/esp_wifi/include/esp_wifi.h"
#include "esp_wifi.h"
#include "soc/soc_caps.h"
#include "components/lwip/include/apps/ping/ping_sock.h"
#include "lwip/sockets.h"
Expand Down
2 changes: 1 addition & 1 deletion ports/espressif/common-hal/wifi/ScannedNetworks.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "shared-bindings/wifi/Radio.h"
#include "shared-bindings/wifi/ScannedNetworks.h"

#include "components/esp_wifi/include/esp_wifi.h"
#include "esp_wifi.h"
#include "soc/soc_caps.h"

static void wifi_scannednetworks_done(wifi_scannednetworks_obj_t *self) {
Expand Down
Loading
Loading