mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
drivers: remove file paths from log statements
Function name and error string are usually sufficient to find the place which has triggered an error. __FILE__ macro generates a string which has absolute file name (with our build system), so there is a lot of long strings present in the program because of that. Fixes https://github.com/espressif/esp-idf/issues/126
This commit is contained in:
parent
60d7440781
commit
0dff9ed79d
@ -20,11 +20,12 @@
|
|||||||
#include "soc/soc.h"
|
#include "soc/soc.h"
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
|
|
||||||
static const char* GPIO_TAG = "GPIO";
|
static const char* GPIO_TAG = "gpio";
|
||||||
#define GPIO_CHECK(a, str, ret_val) if (!(a)) { \
|
#define GPIO_CHECK(a, str, ret_val) \
|
||||||
ESP_LOGE(GPIO_TAG,"%s:%d (%s):%s", __FILE__, __LINE__, __FUNCTION__, str); \
|
if (!(a)) { \
|
||||||
return (ret_val); \
|
ESP_LOGE(GPIO_TAG,"%s(%d): %s", __FUNCTION__, __LINE__, str); \
|
||||||
}
|
return (ret_val); \
|
||||||
|
}
|
||||||
|
|
||||||
const uint32_t GPIO_PIN_MUX_REG[GPIO_PIN_COUNT] = {
|
const uint32_t GPIO_PIN_MUX_REG[GPIO_PIN_COUNT] = {
|
||||||
GPIO_PIN_REG_0,
|
GPIO_PIN_REG_0,
|
||||||
|
@ -20,12 +20,13 @@
|
|||||||
#include "driver/ledc.h"
|
#include "driver/ledc.h"
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
|
|
||||||
static const char* LEDC_TAG = "LEDC";
|
static const char* LEDC_TAG = "ledc";
|
||||||
static portMUX_TYPE ledc_spinlock = portMUX_INITIALIZER_UNLOCKED;
|
static portMUX_TYPE ledc_spinlock = portMUX_INITIALIZER_UNLOCKED;
|
||||||
#define LEDC_CHECK(a, str, ret_val) if (!(a)) { \
|
#define LEDC_CHECK(a, str, ret_val) \
|
||||||
ESP_LOGE(LEDC_TAG,"%s:%d (%s):%s", __FILE__, __LINE__, __FUNCTION__, str); \
|
if (!(a)) { \
|
||||||
return (ret_val); \
|
ESP_LOGE(LEDC_TAG,"%s(%d): %s", __FUNCTION__, __LINE__, str); \
|
||||||
}
|
return (ret_val); \
|
||||||
|
}
|
||||||
|
|
||||||
esp_err_t ledc_timer_set(ledc_mode_t speed_mode, ledc_timer_t timer_sel, uint32_t div_num, uint32_t bit_num, ledc_clk_src_t clk_src)
|
esp_err_t ledc_timer_set(ledc_mode_t speed_mode, ledc_timer_t timer_sel, uint32_t div_num, uint32_t bit_num, ledc_clk_src_t clk_src)
|
||||||
{
|
{
|
||||||
|
@ -23,12 +23,14 @@
|
|||||||
#define PCNT_COUNT_MODE_ERR_STR "PCNT COUNTER MODE ERROR"
|
#define PCNT_COUNT_MODE_ERR_STR "PCNT COUNTER MODE ERROR"
|
||||||
#define PCNT_CTRL_MODE_ERR_STR "PCNT CTRL MODE ERROR"
|
#define PCNT_CTRL_MODE_ERR_STR "PCNT CTRL MODE ERROR"
|
||||||
#define PCNT_EVT_TYPE_ERR_STR "PCNT value type error"
|
#define PCNT_EVT_TYPE_ERR_STR "PCNT value type error"
|
||||||
#define PCNT_CHECK(a,str,ret_val) if(!(a)) { \
|
|
||||||
ESP_LOGE(PCNT_TAG,"%s:%d (%s):%s", __FILE__, __LINE__, __FUNCTION__, str); \
|
|
||||||
return (ret_val); \
|
|
||||||
}
|
|
||||||
|
|
||||||
static const char* PCNT_TAG = "PCNT";
|
static const char* PCNT_TAG = "pcnt";
|
||||||
|
#define PCNT_CHECK(a, str, ret_val) \
|
||||||
|
if (!(a)) { \
|
||||||
|
ESP_LOGE(PCNT_TAG,"%s(%d): %s", __FUNCTION__, __LINE__, str); \
|
||||||
|
return (ret_val); \
|
||||||
|
}
|
||||||
|
|
||||||
static portMUX_TYPE pcnt_spinlock = portMUX_INITIALIZER_UNLOCKED;
|
static portMUX_TYPE pcnt_spinlock = portMUX_INITIALIZER_UNLOCKED;
|
||||||
|
|
||||||
#define PCNT_ENTER_CRITICAL(mux) portENTER_CRITICAL(mux)
|
#define PCNT_ENTER_CRITICAL(mux) portENTER_CRITICAL(mux)
|
||||||
|
@ -43,13 +43,15 @@
|
|||||||
#define RMT_DRIVER_ERROR_STR "RMT DRIVER ERR"
|
#define RMT_DRIVER_ERROR_STR "RMT DRIVER ERR"
|
||||||
#define RMT_DRIVER_LENGTH_ERROR_STR "RMT PARAM LEN ERROR"
|
#define RMT_DRIVER_LENGTH_ERROR_STR "RMT PARAM LEN ERROR"
|
||||||
|
|
||||||
static const char* RMT_TAG = "RMT";
|
static const char* RMT_TAG = "rmt";
|
||||||
static bool s_rmt_driver_installed = false;
|
static bool s_rmt_driver_installed = false;
|
||||||
|
|
||||||
#define RMT_CHECK(a, str, ret) if (!(a)) { \
|
#define RMT_CHECK(a, str, ret_val) \
|
||||||
ESP_LOGE(RMT_TAG,"%s:%d (%s):%s", __FILE__, __LINE__, __FUNCTION__, str); \
|
if (!(a)) { \
|
||||||
return (ret); \
|
ESP_LOGE(RMT_TAG,"%s(%d): %s", __FUNCTION__, __LINE__, str); \
|
||||||
}
|
return (ret_val); \
|
||||||
|
}
|
||||||
|
|
||||||
static portMUX_TYPE rmt_spinlock = portMUX_INITIALIZER_UNLOCKED;
|
static portMUX_TYPE rmt_spinlock = portMUX_INITIALIZER_UNLOCKED;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -20,11 +20,13 @@
|
|||||||
#include "driver/timer.h"
|
#include "driver/timer.h"
|
||||||
#include "driver/periph_ctrl.h"
|
#include "driver/periph_ctrl.h"
|
||||||
|
|
||||||
static const char* TIMER_TAG = "TIMER_GROUP";
|
static const char* TIMER_TAG = "timer_group";
|
||||||
#define TIMER_CHECK(a, str, ret_val) if (!(a)) { \
|
#define TIMER_CHECK(a, str, ret_val) \
|
||||||
ESP_LOGE(TIMER_TAG,"%s:%d (%s):%s", __FILE__, __LINE__, __FUNCTION__, str); \
|
if (!(a)) { \
|
||||||
return (ret_val); \
|
ESP_LOGE(TIMER_TAG,"%s(%d): %s", __FUNCTION__, __LINE__, str); \
|
||||||
}
|
return (ret_val); \
|
||||||
|
}
|
||||||
|
|
||||||
#define TIMER_GROUP_NUM_ERROR "TIMER GROUP NUM ERROR"
|
#define TIMER_GROUP_NUM_ERROR "TIMER GROUP NUM ERROR"
|
||||||
#define TIMER_NUM_ERROR "HW TIMER NUM ERROR"
|
#define TIMER_NUM_ERROR "HW TIMER NUM ERROR"
|
||||||
#define TIMER_PARAM_ADDR_ERROR "HW TIMER PARAM ADDR ERROR"
|
#define TIMER_PARAM_ADDR_ERROR "HW TIMER PARAM ADDR ERROR"
|
||||||
|
@ -27,11 +27,13 @@
|
|||||||
#include "driver/uart.h"
|
#include "driver/uart.h"
|
||||||
#include "driver/gpio.h"
|
#include "driver/gpio.h"
|
||||||
|
|
||||||
static const char* UART_TAG = "UART";
|
static const char* UART_TAG = "uart";
|
||||||
#define UART_CHECK(a, str, ret) if (!(a)) { \
|
#define UART_CHECK(a, str, ret_val) \
|
||||||
ESP_LOGE(UART_TAG,"%s:%d (%s):%s", __FILE__, __LINE__, __FUNCTION__, str); \
|
if (!(a)) { \
|
||||||
return (ret); \
|
ESP_LOGE(UART_TAG,"%s(%d): %s", __FUNCTION__, __LINE__, str); \
|
||||||
}
|
return (ret_val); \
|
||||||
|
}
|
||||||
|
|
||||||
#define UART_EMPTY_THRESH_DEFAULT (10)
|
#define UART_EMPTY_THRESH_DEFAULT (10)
|
||||||
#define UART_FULL_THRESH_DEFAULT (120)
|
#define UART_FULL_THRESH_DEFAULT (120)
|
||||||
#define UART_TOUT_THRESH_DEFAULT (10)
|
#define UART_TOUT_THRESH_DEFAULT (10)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user