Skip to content

Commit

Permalink
Merge branch 'bugfix/remove_-Wno-formate_in_mesh_example' into 'master'
Browse files Browse the repository at this point in the history
wifi_mesh: Remove-Wno-format compile option for mesh examples

Closes IDF-6435

See merge request espressif/esp-idf!22253
  • Loading branch information
MaxwellAlan committed Feb 27, 2023
2 parents ad19981 + f725766 commit 05ce3ce
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 13 deletions.
1 change: 0 additions & 1 deletion 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")
11 changes: 6 additions & 5 deletions examples/mesh/internal_communication/main/mesh_main.c
Expand Up @@ -7,6 +7,7 @@
CONDITIONS OF ANY KIND, either express or implied.
*/
#include <string.h>
#include <inttypes.h>
#include "esp_wifi.h"
#include "esp_mac.h"
#include "esp_event.h"
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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());
}
1 change: 0 additions & 1 deletion examples/mesh/ip_internal_network/main/CMakeLists.txt
Expand Up @@ -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")
5 changes: 3 additions & 2 deletions examples/mesh/ip_internal_network/main/mesh_main.c
Expand Up @@ -7,6 +7,7 @@
CONDITIONS OF ANY KIND, either express or implied.
*/
#include <string.h>
#include <inttypes.h>
#include "esp_wifi.h"
#include "esp_mac.h"
#include "esp_event.h"
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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");
}
2 changes: 1 addition & 1 deletion examples/mesh/ip_internal_network/main/mqtt_app.c
Expand Up @@ -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);
}

Expand Down
1 change: 0 additions & 1 deletion 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")
4 changes: 2 additions & 2 deletions examples/mesh/manual_networking/main/mesh_main.c
Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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());
}

0 comments on commit 05ce3ce

Please sign in to comment.