Skip to content

Commit 8fd3e8c

Browse files
committed
fix(apptrace): fix build error when print lock is enabled
1 parent c7d5320 commit 8fd3e8c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

components/app_trace/app_trace.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
#define ESP_APPTRACE_MAX_VPRINTF_ARGS 256
2727
#define ESP_APPTRACE_HOST_BUF_SIZE 256
2828

29-
#define ESP_APPTRACE_PRINT_LOCK 0
30-
3129
const static char *TAG = "esp_apptrace";
3230

3331
/** tracing module internal data */
@@ -90,7 +88,7 @@ void esp_apptrace_down_buffer_config(uint8_t *buf, uint32_t size)
9088
return;
9189
}
9290
// currently down buffer is supported for JTAG interface only
93-
// TODO: one more argument should be added to this function to specify HW inteface: JTAG, UART0 etc
91+
// TODO: one more argument should be added to this function to specify HW interface: JTAG, UART0 etc
9492
ch = &s_trace_channels[ESP_APPTRACE_DEST_JTAG];
9593
if (ch->hw != NULL) {
9694
if (ch->hw->down_buffer_config != NULL) {

components/app_trace/app_trace_util.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@
99
#include "esp_app_trace_util.h"
1010
#include "sdkconfig.h"
1111

12+
#define ESP_APPTRACE_PRINT_LOCK 0
13+
1214
///////////////////////////////////////////////////////////////////////////////
1315
///////////////////////////////// Locks /////////////////////////////////////
1416
///////////////////////////////////////////////////////////////////////////////
1517

1618
#if ESP_APPTRACE_PRINT_LOCK
17-
static esp_apptrace_lock_t s_log_lock = {.irq_stat = 0, .portmux = portMUX_INITIALIZER_UNLOCKED};
19+
static esp_apptrace_lock_t s_log_lock = { .mux = portMUX_INITIALIZER_UNLOCKED };
1820
#endif
1921

2022
int esp_apptrace_log_lock(void)
@@ -31,7 +33,7 @@ int esp_apptrace_log_lock(void)
3133

3234
void esp_apptrace_log_unlock(void)
3335
{
34-
#if ESP_APPTRACE_PRINT_LOCK
36+
#if ESP_APPTRACE_PRINT_LOCK
3537
esp_apptrace_lock_give(&s_log_lock);
3638
#endif
3739
}
@@ -87,7 +89,7 @@ esp_err_t esp_apptrace_lock_give(esp_apptrace_lock_t *lock)
8789
uint8_t *esp_apptrace_rb_produce(esp_apptrace_rb_t *rb, uint32_t size)
8890
{
8991
uint8_t *ptr = rb->data + rb->wr;
90-
// check for avalable space
92+
// check for available space
9193
if (rb->rd <= rb->wr) {
9294
// |?R......W??|
9395
if (rb->wr + size >= rb->size) {

0 commit comments

Comments
 (0)