Skip to content

Commit ab1087c

Browse files
pi-anldpgeorge
authored andcommitted
esp32: Add basic espressif IDF v5.3 compatibility.
Signed-off-by: Andrew Leech <[email protected]>
1 parent 406bccc commit ab1087c

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

ports/esp32/boards/ESP32_GENERIC_C3/mpconfigboard.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@
88

99
// Enable UART REPL for modules that have an external USB-UART and don't use native USB.
1010
#define MICROPY_HW_ENABLE_UART_REPL (1)
11+
12+
#define USB_SERIAL_JTAG_PACKET_SZ_BYTES (64)

ports/esp32/modnetwork_globals.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@
4040
{ MP_ROM_QSTR(MP_QSTR_AUTH_WPA3_EXT_PSK), MP_ROM_INT(WIFI_AUTH_WPA3_EXT_PSK) },
4141
{ MP_ROM_QSTR(MP_QSTR_AUTH_WPA3_EXT_PSK_MIXED_MODE), MP_ROM_INT(WIFI_AUTH_WPA3_EXT_PSK_MIXED_MODE) },
4242
#endif
43+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0)
44+
{ MP_ROM_QSTR(MP_QSTR_AUTH_DPP), MP_ROM_INT(WIFI_AUTH_DPP) },
45+
#endif
4346
{ MP_ROM_QSTR(MP_QSTR_AUTH_MAX), MP_ROM_INT(WIFI_AUTH_MAX) },
4447
#endif
4548

ports/esp32/network_wlan.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,14 +768,19 @@ static const mp_rom_map_elem_t wlan_if_locals_dict_table[] = {
768768
{ MP_ROM_QSTR(MP_QSTR_SEC_WPA3_EXT_PSK), MP_ROM_INT(WIFI_AUTH_WPA3_EXT_PSK) },
769769
{ MP_ROM_QSTR(MP_QSTR_SEC_WPA3_EXT_PSK_MIXED_MODE), MP_ROM_INT(WIFI_AUTH_WPA3_EXT_PSK_MIXED_MODE) },
770770
#endif
771+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0)
772+
{ MP_ROM_QSTR(MP_QSTR_SEC_DPP), MP_ROM_INT(WIFI_AUTH_DPP) },
773+
#endif
771774

772775
{ MP_ROM_QSTR(MP_QSTR_PM_NONE), MP_ROM_INT(WIFI_PS_NONE) },
773776
{ MP_ROM_QSTR(MP_QSTR_PM_PERFORMANCE), MP_ROM_INT(WIFI_PS_MIN_MODEM) },
774777
{ MP_ROM_QSTR(MP_QSTR_PM_POWERSAVE), MP_ROM_INT(WIFI_PS_MAX_MODEM) },
775778
};
776779
static MP_DEFINE_CONST_DICT(wlan_if_locals_dict, wlan_if_locals_dict_table);
777780

778-
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 2, 0)
781+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0)
782+
_Static_assert(WIFI_AUTH_MAX == 14, "Synchronize WIFI_AUTH_XXX constants with the ESP-IDF. Look at esp-idf/components/esp_wifi/include/esp_wifi_types_generic.h");
783+
#elif ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 2, 0)
779784
_Static_assert(WIFI_AUTH_MAX == 13, "Synchronize WIFI_AUTH_XXX constants with the ESP-IDF. Look at esp-idf/components/esp_wifi/include/esp_wifi_types.h");
780785
#elif ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 5) && ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 1, 0) || ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 1, 2)
781786
_Static_assert(WIFI_AUTH_MAX == 11, "Synchronize WIFI_AUTH_XXX constants with the ESP-IDF. Look at esp-idf/components/esp_wifi/include/esp_wifi_types.h");

ports/esp32/usb_serial_jtag.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ void usb_serial_jtag_poll_rx(void) {
9595
}
9696
}
9797

98+
#ifndef USB_SERIAL_JTAG_PACKET_SZ_BYTES
99+
#define USB_SERIAL_JTAG_PACKET_SZ_BYTES USB_SERIAL_JTAG_RDWR_BYTE_S
100+
#endif
101+
98102
void usb_serial_jtag_tx_strn(const char *str, size_t len) {
99103
while (len) {
100104
size_t l = len;

0 commit comments

Comments
 (0)