Skip to content

Commit d7505eb

Browse files
committed
Merge branch 'minor_cpp_fixes' into 'main'
Added space around macros when using them in strings See merge request app-frameworks/esp-insights!154
2 parents 0f97d97 + 69929c6 commit d7505eb

File tree

8 files changed

+17
-17
lines changed

8 files changed

+17
-17
lines changed

components/esp_diag_data_store/src/rtc_store/rtc_store.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,14 @@ static void rtc_store_write_complete(rbuf_data_t *rbuf_data, size_t len)
187187
{
188188
data_store_info_t *info = (data_store_info_t *) &rbuf_data->store->info;
189189
#if RTC_STORE_DBG_PRINTS
190-
ESP_LOGI(TAG, "before write_complete, filled %"PRIu16", size %u, read_offset %"PRIu16", len %u",
190+
ESP_LOGI(TAG, "before write_complete, filled %" PRIu16 ", size %u, read_offset %" PRIu16 ", len %u",
191191
info->filled, rbuf_data->store->size, info->read_offset, len);
192192
#endif
193193

194194
info->filled += len;
195195

196196
#if RTC_STORE_DBG_PRINTS
197-
ESP_LOGI(TAG, "after write_complete, filled %"PRIu16", size %u, read_offset %"PRIu16", len %u",
197+
ESP_LOGI(TAG, "after write_complete, filled %" PRIu16 ", size %u, read_offset %" PRIu16 ", len %u",
198198
info->filled, rbuf_data->store->size, info->read_offset, len);
199199
#endif
200200
}
@@ -204,7 +204,7 @@ static size_t rtc_store_write_at_offset(rbuf_data_t *rbuf_data, void *data, size
204204
{
205205
data_store_info_t *info = (data_store_info_t *) &rbuf_data->store->info;
206206
#if RTC_STORE_DBG_PRINTS
207-
ESP_LOGI(TAG, "(write_at_offset): size %u, available: %u, filled %u, read_ptr %"PRIu16", to_write %u",
207+
ESP_LOGI(TAG, "(write_at_offset): size %u, available: %u, filled %u, read_ptr %" PRIu16 ", to_write %u",
208208
rbuf_data->store->size, data_store_get_free(rbuf_data->store),
209209
data_store_get_filled(rbuf_data->store), info->read_offset, len);
210210
#endif

components/esp_diagnostics/include/esp_diagnostics.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ esp_err_t esp_diag_log_event(const char *tag, const char *format, ...) __attribu
238238
*/
239239
#define ESP_DIAG_EVENT(tag, format, ...) \
240240
{ \
241-
esp_diag_log_event(tag, "EV (%"PRIu32") %s: " format, esp_log_timestamp(), tag, ##__VA_ARGS__); \
241+
esp_diag_log_event(tag, "EV (%" PRIu32 ") %s: " format, esp_log_timestamp(), tag, ##__VA_ARGS__); \
242242
ESP_LOGI(tag, format, ##__VA_ARGS__); \
243243
}
244244

components/esp_diagnostics/src/esp_diagnostics_heap_metrics.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ esp_err_t esp_diag_heap_metrics_dump(void)
6464
RET_ON_ERR_WITH_LOG(esp_diag_metrics_add_uint(KEY_MIN_FREE, min_free_ever), ESP_LOG_WARN, LOG_TAG,
6565
"Failed to add heap metric key:" KEY_MIN_FREE);
6666

67-
ESP_LOGI(LOG_TAG, KEY_FREE ":0x%"PRIx32" " KEY_LFB ":0x%"PRIx32" " KEY_MIN_FREE ":0x%"PRIx32, free, lfb, min_free_ever);
67+
ESP_LOGI(LOG_TAG, KEY_FREE ":0x%" PRIx32 " " KEY_LFB ":0x%" PRIx32 " " KEY_MIN_FREE ":0x%" PRIx32, free, lfb, min_free_ever);
6868
#ifdef CONFIG_ESP32_SPIRAM_SUPPORT
6969
free = heap_caps_get_free_size(MALLOC_CAP_SPIRAM);
7070
lfb = heap_caps_get_largest_free_block(MALLOC_CAP_SPIRAM);
@@ -77,7 +77,7 @@ esp_err_t esp_diag_heap_metrics_dump(void)
7777
RET_ON_ERR_WITH_LOG(esp_diag_metrics_add_uint(KEY_EXT_MIN_FREE, min_free_ever), ESP_LOG_WARN, LOG_TAG,
7878
"Failed to add heap metric key:" KEY_EXT_MIN_FREE);
7979

80-
ESP_LOGI(LOG_TAG, KEY_EXT_FREE ":0x%"PRIx32" " KEY_EXT_LFB ":0x%"PRIx32" " KEY_EXT_MIN_FREE ":0x%"PRIx32, free, lfb, min_free_ever);
80+
ESP_LOGI(LOG_TAG, KEY_EXT_FREE ":0x%" PRIx32 " " KEY_EXT_LFB ":0x%" PRIx32 " " KEY_EXT_MIN_FREE ":0x%" PRIx32, free, lfb, min_free_ever);
8181
#endif /* CONFIG_ESP32_SPIRAM_SUPPORT */
8282
return ESP_OK;
8383
}

components/esp_diagnostics/src/esp_diagnostics_utils.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@
4242
#endif
4343

4444
#define TASK_SNAP_TAG "task_snap"
45-
#define TASK_INFO_FMT "task:%s state:%"PRIu32" high_watermark:%"PRIu32" "
45+
#define TASK_INFO_FMT "task:%s state:%" PRIu32 " high_watermark:%" PRIu32 " "
4646
#define BT_FMT "bt:"
47-
#define BT_DEPTH_FMT_1 "0x%"PRIx32" "
48-
#define BT_DEPTH_FMT_2 "0x%"PRIx32" 0x%"PRIx32" "
49-
#define BT_DEPTH_FMT_3 "0x%"PRIx32" 0x%"PRIx32" 0x%"PRIx32" "
50-
#define BT_DEPTH_FMT_4 "0x%"PRIx32" 0x%"PRIx32" 0x%"PRIx32" 0x%"PRIx32" "
47+
#define BT_DEPTH_FMT_1 "0x%" PRIx32 " "
48+
#define BT_DEPTH_FMT_2 "0x%" PRIx32 " 0x%" PRIx32 " "
49+
#define BT_DEPTH_FMT_3 "0x%" PRIx32 " 0x%" PRIx32 " 0x%" PRIx32 " "
50+
#define BT_DEPTH_FMT_4 "0x%" PRIx32 " 0x%" PRIx32 " 0x%" PRIx32 " 0x%" PRIx32 " "
5151
#define BT_DEPTH_FMT_8 BT_DEPTH_FMT_4 BT_DEPTH_FMT_4
5252
#define BT_DEPTH_FMT_16 BT_DEPTH_FMT_8 BT_DEPTH_FMT_8
5353

components/esp_diagnostics/src/esp_diagnostics_wifi_metrics.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static void update_min_rssi(int32_t rssi)
5151
if (rssi < s_priv_data.min_rssi) {
5252
s_priv_data.min_rssi = rssi;
5353
esp_diag_metrics_add_int(KEY_MIN_RSSI, rssi);
54-
ESP_LOGI(LOG_TAG, "Wi-Fi RSSI crossed threshold %"PRIi32"", rssi);
54+
ESP_LOGI(LOG_TAG, "Wi-Fi RSSI crossed threshold %" PRIi32, rssi);
5555
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 3, 0)
5656
esp_wifi_set_rssi_threshold(rssi);
5757
#endif
@@ -118,7 +118,7 @@ esp_err_t esp_diag_wifi_metrics_dump(void)
118118
RET_ON_ERR_WITH_LOG(esp_diag_metrics_add_int(KEY_MIN_RSSI, s_priv_data.min_rssi), ESP_LOG_WARN, LOG_TAG,
119119
"Failed to add Wi-Fi metrics key:" KEY_MIN_RSSI);
120120
s_priv_data.prev_rssi = rssi;
121-
ESP_LOGI(LOG_TAG, "%s:%"PRIi32" %s:%"PRIi32"", KEY_RSSI, rssi, KEY_MIN_RSSI, s_priv_data.min_rssi);
121+
ESP_LOGI(LOG_TAG, "%s:%" PRIi32 " %s:%" PRIi32, KEY_RSSI, rssi, KEY_MIN_RSSI, s_priv_data.min_rssi);
122122
}
123123
if (!s_priv_data.status_sent) {
124124
// if for some reason we were not able to add the status, try again

components/esp_insights/src/esp_insights.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ static void esp_insights_first_call(void *priv_data)
118118
esp_insights_entry_t *entry = (esp_insights_entry_t *)priv_data;
119119
esp_rmaker_work_queue_add_task(entry->work_fn, entry->priv_data);
120120
/* Start timer here so that the function is called periodically */
121-
ESP_LOGI(TAG, "Scheduling Insights timer for %"PRIu32" seconds.", entry->cur_seconds);
121+
ESP_LOGI(TAG, "Scheduling Insights timer for %" PRIu32 " seconds.", entry->cur_seconds);
122122
xTimerStart(entry->timer, 0);
123123
}
124124

@@ -534,7 +534,7 @@ static void data_store_event_handler(void* arg, esp_event_base_t event_base,
534534
case ESP_DIAG_DATA_STORE_EVENT_CRITICAL_DATA_WRITE_FAIL:
535535
s_insights_data.log_write_fail_cnt++;
536536
#if INSIGHTS_DEBUG_ENABLED
537-
ESP_LOGI(TAG, "Log write fail count: %"PRIu32, s_insights_data.log_write_fail_cnt);
537+
ESP_LOGI(TAG, "Log write fail count: %" PRIu32, s_insights_data.log_write_fail_cnt);
538538
#endif
539539
break;
540540

examples/diagnostics_smoke_test/main/app_main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ static void smoke_test(void *arg)
6161
if (s_reset_count > MAX_CRASHES) {
6262
ESP_DIAG_EVENT(TAG, "[count][%d]", count);
6363
} else {
64-
ESP_LOGE(TAG, "[count][%d] [crash_count][%"PRIu32"] [excvaddr][0x0f] Crashing...", count, s_reset_count);
64+
ESP_LOGE(TAG, "[count][%d] [crash_count][%" PRIu32 "] [excvaddr][0x0f] Crashing...", count, s_reset_count);
6565
*(int *)0x0F = 0x10;
6666
}
6767
}

0 commit comments

Comments
 (0)