-
Notifications
You must be signed in to change notification settings - Fork 348
ESP-IDF 6.0 with backward compatibility to 5.5 #1417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ | |
| #include "esp_log.h" | ||
| #include "esp_system.h" | ||
| #include "esp_wifi.h" | ||
| #include "esp_idf_version.h" | ||
| #include "freertos/FreeRTOS.h" | ||
| #include "freertos/event_groups.h" | ||
| #include "freertos/task.h" | ||
|
|
@@ -17,6 +18,15 @@ | |
| #include "global_state.h" | ||
| #include "nvs_config.h" | ||
|
|
||
| // ESP-IDF 6.0 compatibility: WiFi interface constants were renamed | ||
| #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(6, 0, 0) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it make sense to reverse the compat check? So if ESP-IDF < 6, make define the old constants as the new constants? So the code is completely ESP-IDF 6. |
||
| #define COMPAT_WIFI_IF_STA WIFI_IF_STA | ||
| #define COMPAT_WIFI_IF_AP WIFI_IF_AP | ||
| #else | ||
| #define COMPAT_WIFI_IF_STA ESP_IF_WIFI_STA | ||
| #define COMPAT_WIFI_IF_AP ESP_IF_WIFI_AP | ||
| #endif | ||
|
|
||
| // Maximum number of access points to scan | ||
| #define MAX_AP_COUNT 20 | ||
|
|
||
|
|
@@ -297,7 +307,7 @@ esp_netif_t * wifi_init_softap(char * ap_ssid) | |
| esp_netif_t * esp_netif_ap = esp_netif_create_default_wifi_ap(); | ||
|
|
||
| uint8_t mac[6]; | ||
| esp_wifi_get_mac(ESP_IF_WIFI_AP, mac); | ||
| esp_wifi_get_mac(COMPAT_WIFI_IF_AP, mac); | ||
| // Format the last 4 bytes of the MAC address as a hexadecimal string | ||
| snprintf(ap_ssid, 32, "Bitaxe_%02X%02X", mac[4], mac[5]); | ||
|
|
||
|
|
@@ -311,7 +321,7 @@ esp_netif_t * wifi_init_softap(char * ap_ssid) | |
| wifi_ap_config.ap.authmode = WIFI_AUTH_OPEN; | ||
| wifi_ap_config.ap.pmf_cfg.required = false; | ||
|
|
||
| ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_AP, &wifi_ap_config)); | ||
| ESP_ERROR_CHECK(esp_wifi_set_config(COMPAT_WIFI_IF_AP, &wifi_ap_config)); | ||
|
|
||
| return esp_netif_ap; | ||
| } | ||
|
|
@@ -384,7 +394,7 @@ esp_netif_t * wifi_init_sta(const char * wifi_ssid, const char * wifi_pass) | |
| // strncpy((char *) wifi_sta_config.sta.password, wifi_pass, 63); | ||
| // wifi_sta_config.sta.password[63] = '\0'; | ||
|
|
||
| ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_STA, &wifi_sta_config)); | ||
| ESP_ERROR_CHECK(esp_wifi_set_config(COMPAT_WIFI_IF_STA, &wifi_sta_config)); | ||
|
|
||
| // IPv6 link-local address will be created after WiFi connection | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -132,8 +132,7 @@ In order to unlock the Input fields for ASIC Frequency and ASIC Core Voltage you | |
|
|
||
| ### Prerequisites | ||
|
|
||
| - Install the ESP-IDF toolchain from https://docs.espressif.com/projects/esp-idf/en/stable/esp32/get-started/ | ||
| - Install nodejs/npm from https://nodejs.org/en/download | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would think nodejs/npm are still needed, or is that now bundled with ESP-IDF 6? |
||
| - Install the ESP-IDF toolchain 5.5 or 6.0 from https://docs.espressif.com/projects/esp-idf/en/stable/esp32/get-started/ | ||
| - (Optional) Install the ESP-IDF extension for VSCode from https://marketplace.visualstudio.com/items?itemName=espressif.esp-idf-extension | ||
|
|
||
| ### Building | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why this is a downgrade? Did they drop backwards compatibility after this version?