Skip to content

Commit a361672

Browse files
authored
Merge pull request #2 from huardti/master
Community PR: idf 5.x support
2 parents 4382e99 + 75a5f0a commit a361672

File tree

6 files changed

+41
-23
lines changed

6 files changed

+41
-23
lines changed

.gitignore

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ Module.symvers
5151
Mkfile.old
5252
dkms.conf
5353

54+
#esp idf
55+
sdkconfig
56+
sdkconfig.old
57+
managed_components/
58+
dependencies.lock
59+
**/build/
60+
5461
# Eclipse
5562
.metadata/
5663
RemoteSystemsTempFiles/.project
@@ -60,9 +67,7 @@ RemoteSystemsTempFiles/.project
6067
*.d
6168
wifi_manager/.cproject
6269
wifi_manager/.project
63-
sdkconfig
64-
sdkconfig.old
65-
**/build/
70+
6671
#doxygen
6772
Doxyfile
6873
wifi_manager/doc/

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
if(IDF_VERSION_MAJOR GREATER_EQUAL 4)
22
idf_component_register(SRC_DIRS src
3-
REQUIRES log nvs_flash mdns wpa_supplicant lwip esp_http_server
3+
REQUIRES log nvs_flash mdns wpa_supplicant lwip esp_http_server esp_wifi
44
INCLUDE_DIRS src
55
EMBED_FILES src/style.css src/code.js src/index.html)
66
else()
77
set(COMPONENT_SRCDIRS src)
88
set(COMPONENT_ADD_INCLUDEDIRS src)
9-
set(COMPONENT_REQUIRES log nvs_flash mdns wpa_supplicant lwip esp_http_server)
9+
set(COMPONENT_REQUIRES log nvs_flash mdns wpa_supplicant lwip esp_http_server esp_wifi)
1010
set(COMPONENT_EMBED_FILES src/style.css src/code.js src/index.html)
1111
register_component()
1212
endif()
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## IDF Component Manager Manifest File
2+
dependencies:
3+
espressif/mdns:
4+
version: "^1.0.3"
5+
rules:
6+
- if: "idf_version >=5.0"

examples/default_demo/main/user_main.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ SOFTWARE.
3030
#include <string.h>
3131
#include <esp_wifi.h>
3232
#include <esp_netif.h>
33-
#include "freertos/FreeRTOS.h"
34-
#include "freertos/task.h"
35-
#include "esp_system.h"
36-
#include "esp_log.h"
33+
#include <freertos/FreeRTOS.h>
34+
#include <freertos/task.h>
35+
#include <esp_system.h>
36+
#include <esp_log.h>
37+
#include <lwip/ip4_addr.h>
3738

3839
#include "wifi_manager.h"
3940

@@ -47,7 +48,7 @@ static const char TAG[] = "main";
4748
void monitoring_task(void *pvParameter)
4849
{
4950
for(;;){
50-
ESP_LOGI(TAG, "free heap: %d",esp_get_free_heap_size());
51+
ESP_LOGI(TAG, "free heap: %"PRIu32, esp_get_free_heap_size());
5152
vTaskDelay( pdMS_TO_TICKS(10000) );
5253
}
5354
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## IDF Component Manager Manifest File
2+
dependencies:
3+
espressif/mdns:
4+
version: "^1.0.3"
5+
rules:
6+
- if: "idf_version >=5.0"

src/wifi_manager.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,25 @@ Contains the freeRTOS task and all necessary support
3434
#include <string.h>
3535
#include <stdbool.h>
3636
#include <stdint.h>
37-
#include "esp_system.h"
37+
#include <esp_system.h>
3838
#include <freertos/FreeRTOS.h>
3939
#include <freertos/queue.h>
4040
#include <freertos/task.h>
4141
#include <freertos/event_groups.h>
4242
#include <freertos/timers.h>
4343
#include <http_app.h>
44-
#include "esp_wifi.h"
45-
#include "esp_event.h"
46-
#include "esp_netif.h"
47-
#include "esp_wifi_types.h"
48-
#include "esp_log.h"
49-
#include "nvs.h"
50-
#include "nvs_flash.h"
51-
#include "mdns.h"
52-
#include "lwip/api.h"
53-
#include "lwip/err.h"
54-
#include "lwip/netdb.h"
55-
#include "lwip/ip4_addr.h"
44+
#include <esp_wifi.h>
45+
#include <esp_event.h>
46+
#include <esp_netif.h>
47+
#include <esp_wifi_types.h>
48+
#include <esp_log.h>
49+
#include <nvs.h>
50+
#include <nvs_flash.h>
51+
#include <mdns.h>
52+
#include <lwip/api.h>
53+
#include <lwip/err.h>
54+
#include <lwip/netdb.h>
55+
#include <lwip/ip4_addr.h>
5656

5757

5858
#include "json.h"

0 commit comments

Comments
 (0)