summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIhorNehrutsa <Ihor.Nehrutsa@gmail.com>2025-01-21 08:48:25 +0200
committerDamien George <damien@micropython.org>2025-01-24 23:17:05 +1100
commit865a4c8bf6868ce488347a76f5f3db8e0dabd11d (patch)
treeb664521f75a39c284ae7844b12f2fee0aea5b5fa
parentc69f0e4eeeb1058ac4a4b1b5b5d1896371e0ecd2 (diff)
esp32: Add support for IDF v5.4.
Add WIFI_AUTH_WPA3_ENTERPRISE and WIFI_AUTH_WPA2_WPA3_ENTERPRISE, and update PPP callback signature for latest lwIP. Co-authored-by: Daniel van de Giessen <daniel@dvdgiessen.nl> Signed-off-by: IhorNehrutsa <Ihor.Nehrutsa@gmail.com>
-rw-r--r--ports/esp32/README.md2
-rw-r--r--ports/esp32/network_ppp.c9
-rw-r--r--ports/esp32/network_wlan.c8
3 files changed, 15 insertions, 4 deletions
diff --git a/ports/esp32/README.md b/ports/esp32/README.md
index bc24e5cd7..8597c85ec 100644
--- a/ports/esp32/README.md
+++ b/ports/esp32/README.md
@@ -28,7 +28,7 @@ manage the ESP32 microcontroller, as well as a way to manage the required
build environment and toolchains needed to build the firmware.
The ESP-IDF changes quickly and MicroPython only supports certain versions.
-Currently MicroPython supports v5.2, v5.2.2, and v5.3.
+Currently MicroPython supports v5.2, v5.2.2, v5.3 and v5.4.
To install the ESP-IDF the full instructions can be found at the
[Espressif Getting Started guide](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html#installation-step-by-step).
diff --git a/ports/esp32/network_ppp.c b/ports/esp32/network_ppp.c
index 5c41cf948..4dd5a3718 100644
--- a/ports/esp32/network_ppp.c
+++ b/ports/esp32/network_ppp.c
@@ -100,7 +100,12 @@ static mp_obj_t ppp_make_new(mp_obj_t stream) {
}
MP_DEFINE_CONST_FUN_OBJ_1(esp_network_ppp_make_new_obj, ppp_make_new);
-static u32_t ppp_output_callback(ppp_pcb *pcb, u8_t *data, u32_t len, void *ctx) {
+#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0)
+static u32_t ppp_output_callback(ppp_pcb *pcb, const void *data, u32_t len, void *ctx)
+#else
+static u32_t ppp_output_callback(ppp_pcb *pcb, u8_t *data, u32_t len, void *ctx)
+#endif
+{
ppp_if_obj_t *self = ctx;
mp_obj_t stream = self->stream;
@@ -109,7 +114,7 @@ static u32_t ppp_output_callback(ppp_pcb *pcb, u8_t *data, u32_t len, void *ctx)
}
int err;
- return mp_stream_rw(stream, data, len, &err, MP_STREAM_RW_WRITE);
+ return mp_stream_rw(stream, (void *)data, len, &err, MP_STREAM_RW_WRITE);
}
static void pppos_client_task(void *self_in) {
diff --git a/ports/esp32/network_wlan.c b/ports/esp32/network_wlan.c
index fed81d28c..e85d1328f 100644
--- a/ports/esp32/network_wlan.c
+++ b/ports/esp32/network_wlan.c
@@ -763,6 +763,10 @@ static const mp_rom_map_elem_t wlan_if_locals_dict_table[] = {
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0)
{ MP_ROM_QSTR(MP_QSTR_SEC_DPP), MP_ROM_INT(WIFI_AUTH_DPP) },
#endif
+ #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0)
+ { MP_ROM_QSTR(MP_QSTR_SEC_WPA3_ENT), MP_ROM_INT(WIFI_AUTH_WPA3_ENTERPRISE) },
+ { MP_ROM_QSTR(MP_QSTR_SEC_WPA2_WPA3_ENT), MP_ROM_INT(WIFI_AUTH_WPA2_WPA3_ENTERPRISE) },
+ #endif
{ MP_ROM_QSTR(MP_QSTR_PM_NONE), MP_ROM_INT(WIFI_PS_NONE) },
{ MP_ROM_QSTR(MP_QSTR_PM_PERFORMANCE), MP_ROM_INT(WIFI_PS_MIN_MODEM) },
@@ -770,7 +774,9 @@ static const mp_rom_map_elem_t wlan_if_locals_dict_table[] = {
};
static MP_DEFINE_CONST_DICT(wlan_if_locals_dict, wlan_if_locals_dict_table);
-#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0)
+#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0)
+_Static_assert(WIFI_AUTH_MAX == 16, "Synchronize WIFI_AUTH_XXX constants with the ESP-IDF. Look at esp-idf/components/esp_wifi/include/esp_wifi_types_generic.h");
+#elif ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0)
_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");
#elif ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 2, 0)
_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");