From 878fd239d6d2658261e452eb6bb94508d3fc0342 Mon Sep 17 00:00:00 2001 From: wanlei Date: Mon, 11 Dec 2023 11:10:42 +0800 Subject: [PATCH] fix(twai): fix build error TWAI_TAG used but not defined bug introduced from efef8401 closes https://github.com/espressif/esp-idf/issues/12760 --- components/driver/twai.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/driver/twai.c b/components/driver/twai.c index 29efc1a33c..96a333f116 100644 --- a/components/driver/twai.c +++ b/components/driver/twai.c @@ -34,6 +34,7 @@ /* ---------------------------- Definitions --------------------------------- */ //Internal Macros +#define TWAI_TAG "TWAI" #define TWAI_CHECK(cond, ret_val) ({ \ if (!(cond)) { \ return (ret_val); \ @@ -47,11 +48,11 @@ }) #define TWAI_SET_FLAG(var, mask) ((var) |= (mask)) #define TWAI_RESET_FLAG(var, mask) ((var) &= ~(mask)) + #ifdef CONFIG_TWAI_ISR_IN_IRAM #define TWAI_ISR_ATTR IRAM_ATTR #define TWAI_MALLOC_CAPS (MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT) #else -#define TWAI_TAG "TWAI" #define TWAI_ISR_ATTR #define TWAI_MALLOC_CAPS MALLOC_CAP_DEFAULT #endif //CONFIG_TWAI_ISR_IN_IRAM @@ -447,7 +448,6 @@ esp_err_t twai_driver_install(const twai_general_config_t *g_config, const twai_ //Allocate GPIO ret = twai_configure_gpio(g_config->tx_io, g_config->rx_io, g_config->clkout_io, g_config->bus_off_io); if (ESP_OK != ret) { - ESP_LOGE(TWAI_TAG, "init gpio for twai failed"); goto err; }