diff --git a/examples/mesh/internal_communication/main/CMakeLists.txt b/examples/mesh/internal_communication/main/CMakeLists.txt index bccc4c5e6e7..686ab05acf9 100644 --- a/examples/mesh/internal_communication/main/CMakeLists.txt +++ b/examples/mesh/internal_communication/main/CMakeLists.txt @@ -1,4 +1,3 @@ idf_component_register(SRCS "mesh_light.c" "mesh_main.c" INCLUDE_DIRS "." "include") -target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format") diff --git a/examples/mesh/internal_communication/main/mesh_main.c b/examples/mesh/internal_communication/main/mesh_main.c index 79930a2cf3e..3dfffb16a8f 100644 --- a/examples/mesh/internal_communication/main/mesh_main.c +++ b/examples/mesh/internal_communication/main/mesh_main.c @@ -7,6 +7,7 @@ CONDITIONS OF ANY KIND, either express or implied. */ #include +#include #include "esp_wifi.h" #include "esp_mac.h" #include "esp_event.h" @@ -104,13 +105,13 @@ void esp_mesh_p2p_tx_main(void *arg) err = esp_mesh_send(&route_table[i], &data, MESH_DATA_P2P, NULL, 0); if (err) { ESP_LOGE(MESH_TAG, - "[ROOT-2-UNICAST:%d][L:%d]parent:"MACSTR" to "MACSTR", heap:%d[err:0x%x, proto:%d, tos:%d]", + "[ROOT-2-UNICAST:%d][L:%d]parent:"MACSTR" to "MACSTR", heap:%" PRId32 "[err:0x%x, proto:%d, tos:%d]", send_count, mesh_layer, MAC2STR(mesh_parent_addr.addr), MAC2STR(route_table[i].addr), esp_get_minimum_free_heap_size(), err, data.proto, data.tos); } else if (!(send_count % 100)) { ESP_LOGW(MESH_TAG, - "[ROOT-2-UNICAST:%d][L:%d][rtableSize:%d]parent:"MACSTR" to "MACSTR", heap:%d[err:0x%x, proto:%d, tos:%d]", + "[ROOT-2-UNICAST:%d][L:%d][rtableSize:%d]parent:"MACSTR" to "MACSTR", heap:%" PRId32 "[err:0x%x, proto:%d, tos:%d]", send_count, mesh_layer, esp_mesh_get_routing_table_size(), MAC2STR(mesh_parent_addr.addr), @@ -155,7 +156,7 @@ void esp_mesh_p2p_rx_main(void *arg) mesh_light_process(&from, data.data, data.size); if (!(recv_count % 1)) { ESP_LOGW(MESH_TAG, - "[#RX:%d/%d][L:%d] parent:"MACSTR", receive from "MACSTR", size:%d, heap:%d, flag:%d[err:0x%x, proto:%d, tos:%d]", + "[#RX:%d/%d][L:%d] parent:"MACSTR", receive from "MACSTR", size:%d, heap:%" PRId32 ", flag:%d[err:0x%x, proto:%d, tos:%d]", recv_count, send_count, mesh_layer, MAC2STR(mesh_parent_addr.addr), MAC2STR(from.addr), data.size, esp_get_minimum_free_heap_size(), flag, err, data.proto, @@ -371,7 +372,7 @@ void mesh_event_handler(void *arg, esp_event_base_t event_base, } break; default: - ESP_LOGI(MESH_TAG, "unknown id:%d", event_id); + ESP_LOGI(MESH_TAG, "unknown id:%" PRId32 "", event_id); break; } } @@ -445,7 +446,7 @@ void app_main(void) /* set the network active duty cycle. (default:10, -1, MESH_PS_NETWORK_DUTY_APPLIED_ENTIRE) */ ESP_ERROR_CHECK(esp_mesh_set_network_duty_cycle(CONFIG_MESH_PS_NWK_DUTY, CONFIG_MESH_PS_NWK_DUTY_DURATION, CONFIG_MESH_PS_NWK_DUTY_RULE)); #endif - ESP_LOGI(MESH_TAG, "mesh starts successfully, heap:%d, %s<%d>%s, ps:%d\n", esp_get_minimum_free_heap_size(), + ESP_LOGI(MESH_TAG, "mesh starts successfully, heap:%" PRId32 ", %s<%d>%s, ps:%d\n", esp_get_minimum_free_heap_size(), esp_mesh_is_root_fixed() ? "root fixed" : "root not fixed", esp_mesh_get_topology(), esp_mesh_get_topology() ? "(chain)":"(tree)", esp_mesh_is_ps_enabled()); } diff --git a/examples/mesh/ip_internal_network/main/CMakeLists.txt b/examples/mesh/ip_internal_network/main/CMakeLists.txt index 55cf4f19d60..06403090a47 100644 --- a/examples/mesh/ip_internal_network/main/CMakeLists.txt +++ b/examples/mesh/ip_internal_network/main/CMakeLists.txt @@ -2,4 +2,3 @@ idf_component_register(SRCS "mesh_main.c" "mesh_netif.c" "mqtt_app.c" INCLUDE_DIRS "." "include") -target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format") diff --git a/examples/mesh/ip_internal_network/main/mesh_main.c b/examples/mesh/ip_internal_network/main/mesh_main.c index a838c7813da..9a56ed149d5 100644 --- a/examples/mesh/ip_internal_network/main/mesh_main.c +++ b/examples/mesh/ip_internal_network/main/mesh_main.c @@ -7,6 +7,7 @@ CONDITIONS OF ANY KIND, either express or implied. */ #include +#include #include "esp_wifi.h" #include "esp_mac.h" #include "esp_event.h" @@ -360,7 +361,7 @@ void mesh_event_handler(void *arg, esp_event_base_t event_base, } break; default: - ESP_LOGI(MESH_TAG, "unknown id:%d", event_id); + ESP_LOGI(MESH_TAG, "unknown id:%" PRId32 "", event_id); break; } } @@ -422,6 +423,6 @@ void app_main(void) ESP_ERROR_CHECK(esp_mesh_set_config(&cfg)); /* mesh start */ ESP_ERROR_CHECK(esp_mesh_start()); - ESP_LOGI(MESH_TAG, "mesh starts successfully, heap:%d, %s\n", esp_get_free_heap_size(), + ESP_LOGI(MESH_TAG, "mesh starts successfully, heap:%" PRId32 ", %s\n", esp_get_free_heap_size(), esp_mesh_is_root_fixed() ? "root fixed" : "root not fixed"); } diff --git a/examples/mesh/ip_internal_network/main/mqtt_app.c b/examples/mesh/ip_internal_network/main/mqtt_app.c index 3dcc200adce..b673dfd5c38 100644 --- a/examples/mesh/ip_internal_network/main/mqtt_app.c +++ b/examples/mesh/ip_internal_network/main/mqtt_app.c @@ -56,7 +56,7 @@ static esp_err_t mqtt_event_handler_cb(esp_mqtt_event_handle_t event) } static void mqtt_event_handler(void *handler_args, esp_event_base_t base, int32_t event_id, void *event_data) { - ESP_LOGD(TAG, "Event dispatched from event loop base=%s, event_id=%d", base, event_id); + ESP_LOGD(TAG, "Event dispatched from event loop base=%s, event_id=%" PRId32 "", base, event_id); mqtt_event_handler_cb(event_data); } diff --git a/examples/mesh/manual_networking/main/CMakeLists.txt b/examples/mesh/manual_networking/main/CMakeLists.txt index bccc4c5e6e7..686ab05acf9 100644 --- a/examples/mesh/manual_networking/main/CMakeLists.txt +++ b/examples/mesh/manual_networking/main/CMakeLists.txt @@ -1,4 +1,3 @@ idf_component_register(SRCS "mesh_light.c" "mesh_main.c" INCLUDE_DIRS "." "include") -target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format") diff --git a/examples/mesh/manual_networking/main/mesh_main.c b/examples/mesh/manual_networking/main/mesh_main.c index 241301cc71e..33958a768d8 100644 --- a/examples/mesh/manual_networking/main/mesh_main.c +++ b/examples/mesh/manual_networking/main/mesh_main.c @@ -269,7 +269,7 @@ void mesh_event_handler(void *arg, esp_event_base_t event_base, } break; default: - ESP_LOGD(MESH_TAG, "event id:%d", event_id); + ESP_LOGD(MESH_TAG, "event id:%" PRId32 "", event_id); break; } } @@ -329,5 +329,5 @@ void app_main(void) ESP_ERROR_CHECK(esp_mesh_set_config(&cfg)); /* mesh start */ ESP_ERROR_CHECK(esp_mesh_start()); - ESP_LOGI(MESH_TAG, "mesh starts successfully, heap:%d\n", esp_get_free_heap_size()); + ESP_LOGI(MESH_TAG, "mesh starts successfully, heap:%" PRId32 "\n", esp_get_free_heap_size()); }