8000 esp32: Add support for IDF v5.4. · micropython/micropython@865a4c8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 865a4c8

Browse files
IhorNehrutsaDvdGiessen
authored andcommitted
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>
1 parent c69f0e4 commit 865a4c8

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

ports/esp32/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ manage the ESP32 microcontroller, as well as a way to manage the required
2828
build environment and toolchains needed to build the firmware.
2929

3030
The ESP-IDF changes quickly and MicroPython only supports certain versions.
31-
Currently MicroPython supports v5.2, v5.2.2, and v5.3.
31+
Currently MicroPython supports v5.2, v5.2.2, v5.3 and v5.4.
3232

3333
To install the ESP-IDF the full instructions can be found at the
3434
[Espressif Getting Started guide](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html#installation-step-by-step).

ports/esp32/network_ppp.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,12 @@ static mp_obj_t ppp_make_new(mp_obj_t stream) {
100100
}
101101
MP_DEFINE_CONST_FUN_OBJ_1(esp_network_ppp_make_new_obj, ppp_make_new);
102102

103-
static u32_t ppp_output_callback(ppp_pcb *pcb, u8_t *data, u32_t len, void *ctx) {
103+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0)
104+
static u32_t ppp_output_callback(ppp_pcb *pcb, const void *data, u32_t len, void *ctx)
105+
#else
106+
static u32_t ppp_output_callback(ppp_pcb *pcb, u8_t *data, u32_t len, void *ctx)
107+
#endif
108+
{
104109
ppp_if_obj_t *self = ctx;
105110

106111
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)
109114
}
110115

111116
int err;
112-
return mp_stream_rw(stream, data, len, &err, MP_STREAM_RW_WRITE);
117+
return mp_stream_rw(stream, (void *)data, len, &err, MP_STREAM_RW_WRITE);
113118
}
114119

115120
static void pppos_client_task(void *self_in) {

ports/esp32/network_wlan.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,14 +763,20 @@ static const mp_rom_map_elem_t wlan_if_locals_dict_table[] = {
763763
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0)
764764
{ MP_ROM_QSTR(MP_QSTR_SEC_DPP), MP_ROM_INT(WIFI_AUTH_DPP) },
765765
#endif
766+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0)
767+
{ MP_ROM_QSTR(MP_QSTR_SEC_WPA3_ENT), MP_ROM_INT(WIFI_AUTH_WPA3_ENTERPRISE) },
768+
{ MP_ROM_QSTR(MP_QSTR_SEC_WPA2_WPA3_ENT), MP_ROM_INT(WIFI_AUTH_WPA2_WPA3_ENTERPRISE) },
769+
#endif
766770

767771
{ MP_ROM_QSTR(MP_QSTR_PM_NONE), MP_ROM_INT(WIFI_PS_NONE) },
768772
{ MP_ROM_QSTR(MP_QSTR_PM_PERFORMANCE), MP_ROM_INT(WIFI_PS_MIN_MODEM) },
769773
{ MP_ROM_QSTR(MP_QSTR_PM_POWERSAVE), MP_ROM_INT(WIFI_PS_MAX_MODEM) },
770774
};
771775
static MP_DEFINE_CONST_DICT(wlan_if_locals_dict, wlan_if_locals_dict_table);
772776

773-
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0)
777+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0)
778+
_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");
779+
#elif ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0)
774780
_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");
775781
#elif ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 2, 0)
776782
_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");

0 commit comments

Comments
 (0)
0