Skip to content

Commit 1ad4d50

Browse files
author
Jiang Jiang Jian
committed
Merge branch 'fix/fix_save_line_in_debug_for_154_v5.5' into 'release/v5.5'
fix(802.15.4): fix line save in 154 debug (v5.5) See merge request espressif/esp-idf!43222
2 parents 16158b4 + 7e50476 commit 1ad4d50

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

components/ieee802154/driver/esp_ieee802154_debug.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,8 @@ void ieee802154_record_print(void)
210210
#if CONFIG_IEEE802154_RECORD_STATE
211211
ESP_EARLY_LOGW(IEEE802154_TAG, "Print the record state, current state index: %d", g_ieee802154_probe.state_index);
212212
for (uint8_t i = 0; i < IEEE802154_ASSERT_RECORD_STATE_SIZE; i++) {
213-
ESP_EARLY_LOGW(IEEE802154_TAG, "index %2d: line:%5s, state:%10s, timestamp: %lld",
214-
i, g_ieee802154_probe.state[i].line_str,
213+
ESP_EARLY_LOGW(IEEE802154_TAG, "index %2d: line:%5lu, state:%10s, timestamp: %lld",
214+
i, g_ieee802154_probe.state[i].line,
215215
ieee802154_state_string[g_ieee802154_probe.state[i].state],
216216
g_ieee802154_probe.state[i].timestamp);
217217
}
@@ -221,8 +221,8 @@ void ieee802154_record_print(void)
221221
#if CONFIG_IEEE802154_RECORD_CMD
222222
ESP_EARLY_LOGW(IEEE802154_TAG, "Print the record cmd, current cmd index: %d", g_ieee802154_probe.cmd_index);
223223
for (uint8_t i = 0; i < IEEE802154_ASSERT_RECORD_CMD_SIZE; i++) {
224-
ESP_EARLY_LOGW(IEEE802154_TAG, "index %2d: line:%5s, cmd:%10s, timestamp: %lld",
225-
i, g_ieee802154_probe.cmd[i].line_str,
224+
ESP_EARLY_LOGW(IEEE802154_TAG, "index %2d: line:%5lu, cmd:%10s, timestamp: %lld",
225+
i, g_ieee802154_probe.cmd[i].line,
226226
ieee802154_get_cmd_string(g_ieee802154_probe.cmd[i].cmd),
227227
g_ieee802154_probe.cmd[i].timestamp);
228228
}

components/ieee802154/private_include/esp_ieee802154_util.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ typedef struct {
7878
#if CONFIG_IEEE802154_RECORD_STATE
7979
#define IEEE802154_ASSERT_RECORD_STATE_SIZE CONFIG_IEEE802154_RECORD_STATE_SIZE
8080
#define ieee802154_set_state(a) do { s_ieee802154_state = a; \
81-
sprintf(g_ieee802154_probe.state[g_ieee802154_probe.state_index].line_str, "%d", __LINE__); \
81+
g_ieee802154_probe.state[g_ieee802154_probe.state_index].line = __LINE__; \
8282
g_ieee802154_probe.state[g_ieee802154_probe.state_index].timestamp = esp_timer_get_time(); \
8383
g_ieee802154_probe.state[g_ieee802154_probe.state_index++].state = a; \
8484
g_ieee802154_probe.state_index = \
@@ -89,7 +89,7 @@ typedef struct {
8989
* @brief The table of recording IEEE802154 state command.
9090
*/
9191
typedef struct {
92-
char line_str[5]; /*!< record which line in esp_ieee802154_dev.c changes the state */
92+
uint32_t line; /*!< record which line in esp_ieee802154_dev.c changes the state */
9393
ieee802154_state_t state; /*!< record current radio state */
9494
uint64_t timestamp; /*!< record timestamp */
9595
} ieee802154_state_info_t;
@@ -100,7 +100,7 @@ typedef struct {
100100
#if CONFIG_IEEE802154_RECORD_CMD
101101
#define IEEE802154_ASSERT_RECORD_CMD_SIZE CONFIG_IEEE802154_RECORD_CMD_SIZE
102102
#define ieee802154_set_cmd(a) do { ieee802154_ll_set_cmd(a); \
103-
sprintf(g_ieee802154_probe.cmd[g_ieee802154_probe.cmd_index].line_str, "%d", __LINE__); \
103+
g_ieee802154_probe.cmd[g_ieee802154_probe.cmd_index].line = __LINE__; \
104104
g_ieee802154_probe.cmd[g_ieee802154_probe.cmd_index].timestamp = esp_timer_get_time(); \
105105
g_ieee802154_probe.cmd[g_ieee802154_probe.cmd_index++].cmd = a; \
106106
g_ieee802154_probe.cmd_index = \
@@ -111,7 +111,7 @@ typedef struct {
111111
* @brief The table of recording IEEE802154 radio command.
112112
*/
113113
typedef struct {
114-
char line_str[5]; /*!< record which line in esp_ieee802154_dev.c set the command */
114+
uint32_t line; /*!< record which line in esp_ieee802154_dev.c set the command */
115115
ieee802154_ll_cmd_t cmd; /*!< record current command */
116116
uint64_t timestamp; /*!< record timestamp */
117117
} ieee802154_cmd_info_t;

0 commit comments

Comments
 (0)