diff --git a/components/esp_modem/examples/ap_to_pppos/main/ap_to_pppos.c b/components/esp_modem/examples/ap_to_pppos/main/ap_to_pppos.c index 634b8c18f..709bf4ecc 100644 --- a/components/esp_modem/examples/ap_to_pppos/main/ap_to_pppos.c +++ b/components/esp_modem/examples/ap_to_pppos/main/ap_to_pppos.c @@ -11,12 +11,13 @@ #include "esp_wifi.h" #include "esp_event.h" #include "esp_log.h" +#include "esp_idf_version.h" #include "nvs_flash.h" #include "lwip/lwip_napt.h" #include "freertos/FreeRTOS.h" #include "freertos/event_groups.h" #include "network_dce.h" -#if ESP_IDF_VERSION_MAJOR >= 5 +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) #include "esp_mac.h" #include "dhcpserver/dhcpserver.h" #endif diff --git a/components/esp_modem/idf_component.yml b/components/esp_modem/idf_component.yml index 3ec8477f1..5acd69408 100644 --- a/components/esp_modem/idf_component.yml +++ b/components/esp_modem/idf_component.yml @@ -1,4 +1,4 @@ -version: "0.1.20" +version: "0.1.21" description: esp modem url: https://github.com/espressif/esp-protocols/tree/master/components/esp_modem dependencies: diff --git a/components/esp_modem/private_include/uart_compat.h b/components/esp_modem/private_include/uart_compat.h index 28ae09579..456763b11 100644 --- a/components/esp_modem/private_include/uart_compat.h +++ b/components/esp_modem/private_include/uart_compat.h @@ -15,6 +15,7 @@ #pragma once #include "esp_log.h" +#include "esp_idf_version.h" #include "driver/uart.h" /** @@ -23,7 +24,7 @@ */ static inline int uart_write_bytes_compat(uart_port_t uart_num, const void* src, size_t size) { -#if ESP_IDF_VERSION_MAJOR >= 4 && ESP_IDF_VERSION_MINOR >= 3 +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 3, 0) const void *data = src; #else auto *data = reinterpret_cast(src); diff --git a/components/esp_modem/src/esp_modem_netif.cpp b/components/esp_modem/src/esp_modem_netif.cpp index fa731f145..b7acf4a07 100644 --- a/components/esp_modem/src/esp_modem_netif.cpp +++ b/components/esp_modem/src/esp_modem_netif.cpp @@ -17,6 +17,7 @@ #include #include #include +#include "esp_idf_version.h" #include "cxx_include/esp_modem_netif.hpp" #include "cxx_include/esp_modem_dte.hpp" #include "esp_netif_ppp.h" @@ -59,7 +60,7 @@ esp_err_t Netif::esp_modem_post_attach(esp_netif_t *esp_netif, void *args) esp_netif_ppp_config_t ppp_config = { .ppp_phase_event_enabled = true, // assuming phase enabled, as earlier IDFs .ppp_error_event_enabled = false }; // don't provide cfg getters so we enable both events -#if ESP_IDF_VERSION_MAJOR >= 4 && ESP_IDF_VERSION_MINOR >= 4 +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 0) esp_netif_ppp_get_params(esp_netif, &ppp_config); #endif // ESP-IDF >= v4.4 if (!ppp_config.ppp_error_event_enabled) {