fix(common): removed Wno-format flag and fixed formatting warnings

This commit is contained in:
Suren Gabrielyan
2023-07-20 13:48:50 +04:00
parent 19baa7d43e
commit c48e44205d
27 changed files with 27 additions and 41 deletions

View File

@ -27,7 +27,6 @@ idf_component_register(SRCS ${asio_sources}
INCLUDE_DIRS "asio/asio/include" "port/include" INCLUDE_DIRS "asio/asio/include" "port/include"
PRIV_INCLUDE_DIRS ${asio_priv_includes} PRIV_INCLUDE_DIRS ${asio_priv_includes}
REQUIRES lwip) REQUIRES lwip)
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
if(CONFIG_ASIO_SSL_SUPPORT) if(CONFIG_ASIO_SSL_SUPPORT)
if(CONFIG_ASIO_USE_ESP_WOLFSSL) if(CONFIG_ASIO_USE_ESP_WOLFSSL)

View File

@ -5,4 +5,3 @@ idf_component_register(SRCS "modem_console_main.cpp"
"ping_handle.c" "ping_handle.c"
REQUIRES console esp_http_client nvs_flash REQUIRES console esp_http_client nvs_flash
INCLUDE_DIRS ".") INCLUDE_DIRS ".")
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")

View File

@ -173,7 +173,7 @@ extern "C" void app_main(void)
ESP_LOGI(TAG, "Waiting for USB device connection..."); ESP_LOGI(TAG, "Waiting for USB device connection...");
auto dte = create_usb_dte(&dte_config); auto dte = create_usb_dte(&dte_config);
dte->set_error_cb([&](terminal_error err) { dte->set_error_cb([&](terminal_error err) {
ESP_LOGI(TAG, "error handler %d", err); ESP_LOGI(TAG, "error handler %d", (int)err);
if (err == terminal_error::DEVICE_GONE) { if (err == terminal_error::DEVICE_GONE) {
exit_signal.set(1); exit_signal.set(1);
} }
@ -482,7 +482,7 @@ extern "C" void app_main(void)
// wait for exit // wait for exit
exit_signal.wait_any(1, UINT32_MAX); exit_signal.wait_any(1, UINT32_MAX);
s_repl->del(s_repl); s_repl->del(s_repl);
ESP_LOGI(TAG, "Exiting...%d", esp_get_free_heap_size()); ESP_LOGI(TAG, "Exiting...%" PRIu32, esp_get_free_heap_size());
#if defined(CONFIG_EXAMPLE_SERIAL_CONFIG_USB) #if defined(CONFIG_EXAMPLE_SERIAL_CONFIG_USB)
// USB example runs in a loop to demonstrate hot-plugging and sudden disconnection features. // USB example runs in a loop to demonstrate hot-plugging and sudden disconnection features.
} // while (1) } // while (1)

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Unlicense OR CC0-1.0 * SPDX-License-Identifier: Unlicense OR CC0-1.0
*/ */
@ -28,7 +28,7 @@ static void cmd_ping_on_ping_success(esp_ping_handle_t hdl, void *args)
esp_ping_get_profile(hdl, ESP_PING_PROF_IPADDR, &target_addr, sizeof(target_addr)); esp_ping_get_profile(hdl, ESP_PING_PROF_IPADDR, &target_addr, sizeof(target_addr));
esp_ping_get_profile(hdl, ESP_PING_PROF_SIZE, &recv_len, sizeof(recv_len)); esp_ping_get_profile(hdl, ESP_PING_PROF_SIZE, &recv_len, sizeof(recv_len));
esp_ping_get_profile(hdl, ESP_PING_PROF_TIMEGAP, &elapsed_time, sizeof(elapsed_time)); esp_ping_get_profile(hdl, ESP_PING_PROF_TIMEGAP, &elapsed_time, sizeof(elapsed_time));
ESP_LOGI(TAG, "%d bytes from %s icmp_seq=%d ttl=%d time=%d ms\n", ESP_LOGI(TAG, "%" PRIu32 " bytes from %s icmp_seq=%d ttl=%d time=%" PRIu32 " ms\n",
recv_len, inet_ntoa(target_addr.u_addr.ip4), seqno, ttl, elapsed_time); recv_len, inet_ntoa(target_addr.u_addr.ip4), seqno, ttl, elapsed_time);
} }
@ -57,7 +57,7 @@ static void cmd_ping_on_ping_end(esp_ping_handle_t hdl, void *args)
} else { } else {
ESP_LOGI(TAG, "\n--- %s ping statistics ---\n", inet6_ntoa(*ip_2_ip6(&target_addr))); ESP_LOGI(TAG, "\n--- %s ping statistics ---\n", inet6_ntoa(*ip_2_ip6(&target_addr)));
} }
ESP_LOGI(TAG, "%d packets transmitted, %d received, %d%% packet loss, time %dms\n", ESP_LOGI(TAG, "%" PRIu32 " packets transmitted, %" PRIu32 " received, %" PRIu32 " packet loss, time %" PRIu32 "ms\n",
transmitted, received, loss, total_time_ms); transmitted, received, loss, total_time_ms);
// delete the ping sessions, so that we clean up all resources and can create a new ping session // delete the ping sessions, so that we clean up all resources and can create a new ping session
// we don't have to call delete function in the callback, instead we can call delete function from other tasks // we don't have to call delete function in the callback, instead we can call delete function from other tasks

View File

@ -1,3 +1,2 @@
idf_component_register(SRCS "modem_psm.c" idf_component_register(SRCS "modem_psm.c"
INCLUDE_DIRS ".") INCLUDE_DIRS ".")

View File

@ -9,4 +9,3 @@ idf_component_register(SRCS "modem_client.cpp"
"tcp_transport_at.cpp" "tcp_transport_at.cpp"
"${device_srcs}" "${device_srcs}"
INCLUDE_DIRS ".") INCLUDE_DIRS ".")
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")

View File

@ -34,7 +34,7 @@ static const int GOT_DATA_BIT = BIT2;
static void mqtt_event_handler(void *handler_args, esp_event_base_t base, int32_t event_id, void *event_data) 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);
esp_mqtt_event_handle_t event = (esp_mqtt_event_handle_t)event_data; esp_mqtt_event_handle_t event = (esp_mqtt_event_handle_t)event_data;
esp_mqtt_client_handle_t client = event->client; esp_mqtt_client_handle_t client = event->client;
int msg_id; int msg_id;

View File

@ -120,14 +120,14 @@ bool DCE::at_to_sock()
{ {
uint64_t data; uint64_t data;
read(data_ready_fd, &data, sizeof(data)); read(data_ready_fd, &data, sizeof(data));
ESP_LOGD(TAG, "select read: modem data available %x", data); ESP_LOGD(TAG, "select read: modem data available %" PRIu64, data);
if (!signal.wait(IDLE, 1000)) { if (!signal.wait(IDLE, 1000)) {
ESP_LOGE(TAG, "Failed to get idle"); ESP_LOGE(TAG, "Failed to get idle");
close_sock(); close_sock();
return false; return false;
} }
if (state != status::IDLE) { if (state != status::IDLE) {
ESP_LOGE(TAG, "Unexpected state %d", state); ESP_LOGE(TAG, "Unexpected state %d", static_cast<int>(state));
close_sock(); close_sock();
return false; return false;
} }
@ -145,7 +145,7 @@ bool DCE::sock_to_at()
return false; return false;
} }
if (state != status::IDLE) { if (state != status::IDLE) {
ESP_LOGE(TAG, "Unexpected state %d", state); ESP_LOGE(TAG, "Unexpected state %d", static_cast<int>(state));
close_sock(); close_sock();
return false; return false;
} }

View File

@ -128,7 +128,7 @@ esp_modem::return_type name(__VA_ARGS__);
return false; return false;
} }
if (state != status::IDLE) { if (state != status::IDLE) {
ESP_LOGE("dce", "Unexpected state %d", state); ESP_LOGE("dce", "Unexpected state %d", static_cast<int>(state));
return false; return false;
} }
return true; return true;

View File

@ -1,3 +1,2 @@
idf_component_register(SRCS "pppos_client_main.c" idf_component_register(SRCS "pppos_client_main.c"
INCLUDE_DIRS ".") INCLUDE_DIRS ".")
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")

View File

@ -60,7 +60,7 @@ if ((xEventGroupGetBits(event_group) & USB_DISCONNECTED_BIT) == USB_DISCONNECTED
static void mqtt_event_handler(void *handler_args, esp_event_base_t base, int32_t event_id, void *event_data) 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=%" PRIu32, base, event_id);
esp_mqtt_event_handle_t event = event_data; esp_mqtt_event_handle_t event = event_data;
esp_mqtt_client_handle_t client = event->client; esp_mqtt_client_handle_t client = event->client;
int msg_id; int msg_id;
@ -102,7 +102,7 @@ static void mqtt_event_handler(void *handler_args, esp_event_base_t base, int32_
static void on_ppp_changed(void *arg, esp_event_base_t event_base, static void on_ppp_changed(void *arg, esp_event_base_t event_base,
int32_t event_id, void *event_data) int32_t event_id, void *event_data)
{ {
ESP_LOGI(TAG, "PPP state changed event %d", event_id); ESP_LOGI(TAG, "PPP state changed event %" PRIu32, event_id);
if (event_id == NETIF_PPP_ERRORUSER) { if (event_id == NETIF_PPP_ERRORUSER) {
/* User interrupted event from esp-netif */ /* User interrupted event from esp-netif */
esp_netif_t *netif = event_data; esp_netif_t *netif = event_data;
@ -114,7 +114,7 @@ static void on_ppp_changed(void *arg, esp_event_base_t event_base,
static void on_ip_event(void *arg, esp_event_base_t event_base, static void on_ip_event(void *arg, esp_event_base_t event_base,
int32_t event_id, void *event_data) int32_t event_id, void *event_data)
{ {
ESP_LOGD(TAG, "IP event! %d", event_id); ESP_LOGD(TAG, "IP event! %" PRIu32, event_id);
if (event_id == IP_EVENT_PPP_GOT_IP) { if (event_id == IP_EVENT_PPP_GOT_IP) {
esp_netif_dns_info_t dns_info; esp_netif_dns_info_t dns_info;

View File

@ -8,5 +8,3 @@ set_target_properties(${COMPONENT_LIB} PROPERTIES
CXX_STANDARD_REQUIRED ON CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS ON CXX_EXTENSIONS ON
) )
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Unlicense OR CC0-1.0 * SPDX-License-Identifier: Unlicense OR CC0-1.0
*/ */
@ -27,7 +27,7 @@ static void on_modem_event(void *arg, esp_event_base_t event_base,
int32_t event_id, void *event_data) int32_t event_id, void *event_data)
{ {
if (event_base == IP_EVENT) { if (event_base == IP_EVENT) {
ESP_LOGD(TAG, "IP event! %d", event_id); ESP_LOGD(TAG, "IP event! %" PRId32, event_id);
if (event_id == IP_EVENT_PPP_GOT_IP) { if (event_id == IP_EVENT_PPP_GOT_IP) {
esp_netif_dns_info_t dns_info; esp_netif_dns_info_t dns_info;
@ -61,7 +61,7 @@ static void on_modem_event(void *arg, esp_event_base_t event_base,
static void on_ppp_changed(void *arg, esp_event_base_t event_base, static void on_ppp_changed(void *arg, esp_event_base_t event_base,
int32_t event_id, void *event_data) int32_t event_id, void *event_data)
{ {
ESP_LOGI(TAG, "PPP state changed event %d", event_id); ESP_LOGI(TAG, "PPP state changed event %" PRId32, event_id);
if (event_id == NETIF_PPP_ERRORUSER) { if (event_id == NETIF_PPP_ERRORUSER) {
/* User interrupted event from esp-netif */ /* User interrupted event from esp-netif */
esp_netif_t *netif = static_cast<esp_netif_t *>(event_data); esp_netif_t *netif = static_cast<esp_netif_t *>(event_data);

View File

@ -4,5 +4,3 @@ idf_component_register(SRCS "esp_mqtt_cxx.cpp"
INCLUDE_DIRS "include" INCLUDE_DIRS "include"
REQUIRES mqtt REQUIRES mqtt
) )
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")

View File

@ -153,7 +153,7 @@ Client::Client(esp_mqtt_client_config_t const &config) : handler(esp_mqtt_clien
void Client::mqtt_event_handler(void *handler_args, esp_event_base_t base, int32_t event_id, void *event_data) noexcept void Client::mqtt_event_handler(void *handler_args, esp_event_base_t base, int32_t event_id, void *event_data) noexcept
{ {
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=%" PRIu32, base, event_id);
auto *event = static_cast<esp_mqtt_event_t *>(event_data); auto *event = static_cast<esp_mqtt_event_t *>(event_data);
auto &client = *static_cast<Client *>(handler_args); auto &client = *static_cast<Client *>(handler_args);
switch (event->event_id) { switch (event->event_id) {

View File

@ -1,3 +1,2 @@
idf_component_register(SRCS "mqtt_ssl_example.cpp" idf_component_register(SRCS "mqtt_ssl_example.cpp"
INCLUDE_DIRS ".") INCLUDE_DIRS ".")
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")

View File

@ -54,7 +54,7 @@ namespace mqtt = idf::mqtt;
extern "C" void app_main(void) extern "C" void app_main(void)
{ {
ESP_LOGI(TAG, "[APP] Startup.."); ESP_LOGI(TAG, "[APP] Startup..");
ESP_LOGI(TAG, "[APP] Free memory: %d bytes", esp_get_free_heap_size()); ESP_LOGI(TAG, "[APP] Free memory: %" PRIu32 " bytes", esp_get_free_heap_size());
ESP_LOGI(TAG, "[APP] IDF version: %s", esp_get_idf_version()); ESP_LOGI(TAG, "[APP] IDF version: %s", esp_get_idf_version());
esp_log_level_set("*", ESP_LOG_INFO); esp_log_level_set("*", ESP_LOG_INFO);

View File

@ -1,3 +1,2 @@
idf_component_register(SRCS "mqtt_tcp_example.cpp" idf_component_register(SRCS "mqtt_tcp_example.cpp"
INCLUDE_DIRS ".") INCLUDE_DIRS ".")
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")

View File

@ -49,7 +49,7 @@ private:
extern "C" void app_main(void) extern "C" void app_main(void)
{ {
ESP_LOGI(TAG, "[APP] Startup.."); ESP_LOGI(TAG, "[APP] Startup..");
ESP_LOGI(TAG, "[APP] Free memory: %d bytes", esp_get_free_heap_size()); ESP_LOGI(TAG, "[APP] Free memory: %" PRIu32 " bytes", esp_get_free_heap_size());
ESP_LOGI(TAG, "[APP] IDF version: %s", esp_get_idf_version()); ESP_LOGI(TAG, "[APP] IDF version: %s", esp_get_idf_version());
esp_log_level_set("*", ESP_LOG_INFO); esp_log_level_set("*", ESP_LOG_INFO);

View File

@ -20,7 +20,6 @@ idf_component_register(
PRIV_INCLUDE_DIRS "private_include" PRIV_INCLUDE_DIRS "private_include"
REQUIRES ${dependencies} REQUIRES ${dependencies}
PRIV_REQUIRES ${private_dependencies}) PRIV_REQUIRES ${private_dependencies})
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
if(${target} STREQUAL "linux") if(${target} STREQUAL "linux")
target_link_libraries(${COMPONENT_LIB} PRIVATE "-lbsd") target_link_libraries(${COMPONENT_LIB} PRIVATE "-lbsd")

View File

@ -1,3 +1,2 @@
idf_component_register(SRCS "mdns_example_main.c" idf_component_register(SRCS "mdns_example_main.c"
INCLUDE_DIRS ".") INCLUDE_DIRS ".")
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")

View File

@ -94,7 +94,7 @@ static void mdns_print_results(mdns_result_t *results)
int i = 1, t; int i = 1, t;
while (r) { while (r) {
if (r->esp_netif) { if (r->esp_netif) {
printf("%d: Interface: %s, Type: %s, TTL: %u\n", i++, esp_netif_get_ifkey(r->esp_netif), printf("%d: Interface: %s, Type: %s, TTL: %" PRIu32 "\n", i++, esp_netif_get_ifkey(r->esp_netif),
ip_protocol_str[r->ip_protocol], r->ttl); ip_protocol_str[r->ip_protocol], r->ttl);
} }
if (r->instance_name) { if (r->instance_name) {

View File

@ -1476,7 +1476,7 @@ static void _mdns_dispatch_tx_packet(mdns_tx_packet_t *p)
_mdns_set_u16(packet, MDNS_HEAD_ADDITIONAL_OFFSET, count); _mdns_set_u16(packet, MDNS_HEAD_ADDITIONAL_OFFSET, count);
#ifdef MDNS_ENABLE_DEBUG #ifdef MDNS_ENABLE_DEBUG
_mdns_dbg_printf("\nTX[%u][%u]: ", p->tcpip_if, p->ip_protocol); _mdns_dbg_printf("\nTX[%lu][%lu]: ", (unsigned long)p->tcpip_if, (unsigned long)p->ip_protocol);
if (p->dst.type == ESP_IPADDR_TYPE_V4) { if (p->dst.type == ESP_IPADDR_TYPE_V4) {
_mdns_dbg_printf("To: " IPSTR ":%u, ", IP2STR(&p->dst.u_addr.ip4), p->port); _mdns_dbg_printf("To: " IPSTR ":%u, ", IP2STR(&p->dst.u_addr.ip4), p->port);
} else { } else {
@ -3492,7 +3492,7 @@ void mdns_parse_packet(mdns_rx_packet_t *packet)
mdns_search_once_t *search_result = NULL; mdns_search_once_t *search_result = NULL;
#ifdef MDNS_ENABLE_DEBUG #ifdef MDNS_ENABLE_DEBUG
_mdns_dbg_printf("\nRX[%u][%u]: ", packet->tcpip_if, (uint32_t)packet->ip_protocol); _mdns_dbg_printf("\nRX[%lu][%lu]: ", (unsigned long)packet->tcpip_if, (unsigned long)packet->ip_protocol);
if (packet->src.type == ESP_IPADDR_TYPE_V4) { if (packet->src.type == ESP_IPADDR_TYPE_V4) {
_mdns_dbg_printf("From: " IPSTR ":%u, To: " IPSTR ", ", IP2STR(&packet->src.u_addr.ip4), packet->src_port, IP2STR(&packet->dest.u_addr.ip4)); _mdns_dbg_printf("From: " IPSTR ":%u, To: " IPSTR ", ", IP2STR(&packet->src.u_addr.ip4), packet->src_port, IP2STR(&packet->dest.u_addr.ip4));
} else { } else {
@ -6537,7 +6537,7 @@ void mdns_debug_packet(const uint8_t *data, size_t len)
mdns_name_t *name = &n; mdns_name_t *name = &n;
memset(name, 0, sizeof(mdns_name_t)); memset(name, 0, sizeof(mdns_name_t));
_mdns_dbg_printf("Packet[%u]: ", t); _mdns_dbg_printf("Packet[%" PRIu32 "]: ", t);
header.id = _mdns_read_u16(data, MDNS_HEAD_ID_OFFSET); header.id = _mdns_read_u16(data, MDNS_HEAD_ID_OFFSET);
header.flags = _mdns_read_u16(data, MDNS_HEAD_FLAGS_OFFSET); header.flags = _mdns_read_u16(data, MDNS_HEAD_FLAGS_OFFSET);
@ -6675,7 +6675,7 @@ void mdns_debug_packet(const uint8_t *data, size_t len)
if (flush) { if (flush) {
_mdns_dbg_printf("FLUSH "); _mdns_dbg_printf("FLUSH ");
} }
_mdns_dbg_printf("%u ", ttl); _mdns_dbg_printf("%" PRIu32, ttl);
_mdns_dbg_printf("[%u] ", data_len); _mdns_dbg_printf("[%u] ", data_len);
if (type == MDNS_TYPE_PTR) { if (type == MDNS_TYPE_PTR) {
if (!_mdns_parse_fqdn(data, data_ptr, name, len)) { if (!_mdns_parse_fqdn(data, data_ptr, name, len)) {

View File

@ -372,7 +372,7 @@ static bool create_pcb(mdns_if_t tcpip_if, mdns_ip_protocol_t ip_protocol)
esp_err_t _mdns_pcb_init(mdns_if_t tcpip_if, mdns_ip_protocol_t ip_protocol) esp_err_t _mdns_pcb_init(mdns_if_t tcpip_if, mdns_ip_protocol_t ip_protocol)
{ {
ESP_LOGI(TAG, "_mdns_pcb_init(tcpip_if=%d, ip_protocol=%d)", tcpip_if, ip_protocol); ESP_LOGI(TAG, "_mdns_pcb_init(tcpip_if=%lu, ip_protocol=%lu)", (unsigned long)tcpip_if, (unsigned long)ip_protocol);
if (!create_pcb(tcpip_if, ip_protocol)) { if (!create_pcb(tcpip_if, ip_protocol)) {
return ESP_FAIL; return ESP_FAIL;
} }

View File

@ -159,7 +159,7 @@
#define PCB_STATE_IS_RUNNING(s) (s->state == PCB_RUNNING) #define PCB_STATE_IS_RUNNING(s) (s->state == PCB_RUNNING)
#ifndef HOOK_MALLOC_FAILED #ifndef HOOK_MALLOC_FAILED
#define HOOK_MALLOC_FAILED ESP_LOGE(TAG, "Cannot allocate memory (line: %d, free heap: %d bytes)", __LINE__, esp_get_free_heap_size()); #define HOOK_MALLOC_FAILED ESP_LOGE(TAG, "Cannot allocate memory (line: %d, free heap: %" PRIu32 " bytes)", __LINE__, esp_get_free_heap_size());
#endif #endif
typedef size_t mdns_if_t; typedef size_t mdns_if_t;

View File

@ -1,3 +1,2 @@
idf_component_register(SRCS "main.c" "mdns_test.c" idf_component_register(SRCS "main.c" "mdns_test.c"
INCLUDE_DIRS ".") INCLUDE_DIRS ".")
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")

View File

@ -92,7 +92,7 @@ static void initialise_mdns(void)
void app_main(void) void app_main(void)
{ {
ESP_LOGI(TAG, "[APP] Free memory: %d bytes", esp_get_free_heap_size()); ESP_LOGI(TAG, "[APP] Free memory: %" PRIu32 " bytes", esp_get_free_heap_size());
ESP_LOGI(TAG, "[APP] IDF version: %s", esp_get_idf_version()); ESP_LOGI(TAG, "[APP] IDF version: %s", esp_get_idf_version());
ESP_ERROR_CHECK(nvs_flash_init()); ESP_ERROR_CHECK(nvs_flash_init());