2021-08-05 10:30:10 -04:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: 2016-2021 Espressif Systems (Shanghai) CO LTD
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
2017-04-11 03:44:43 -04:00
|
|
|
|
|
|
|
#pragma once
|
2020-07-21 01:07:34 -04:00
|
|
|
#include "esp_rom_sys.h"
|
2020-09-25 03:23:52 -04:00
|
|
|
|
2017-04-11 03:44:43 -04:00
|
|
|
/**
|
|
|
|
* @file soc_log.h
|
|
|
|
* @brief SOC library logging functions
|
|
|
|
*
|
|
|
|
* To make SOC library compatible with environments which don't use ESP-IDF,
|
|
|
|
* this header file provides wrappers for logging functions.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef ESP_PLATFORM
|
|
|
|
#include "esp_log.h"
|
2018-10-15 02:59:46 -04:00
|
|
|
#define SOC_LOGE(tag, fmt, ...) ESP_EARLY_LOGE(tag, fmt, ##__VA_ARGS__)
|
|
|
|
#define SOC_LOGW(tag, fmt, ...) ESP_EARLY_LOGW(tag, fmt, ##__VA_ARGS__)
|
|
|
|
#define SOC_LOGI(tag, fmt, ...) ESP_EARLY_LOGI(tag, fmt, ##__VA_ARGS__)
|
|
|
|
#define SOC_LOGD(tag, fmt, ...) ESP_EARLY_LOGD(tag, fmt, ##__VA_ARGS__)
|
|
|
|
#define SOC_LOGV(tag, fmt, ...) ESP_EARLY_LOGV(tag, fmt, ##__VA_ARGS__)
|
2017-04-11 03:44:43 -04:00
|
|
|
|
|
|
|
#else
|
2020-03-09 10:34:02 -04:00
|
|
|
#include "sdkconfig.h"
|
|
|
|
#ifdef CONFIG_IDF_TARGET_ESP32
|
2020-07-21 01:07:34 -04:00
|
|
|
#include "esp32/rom/ets_sys.h" // will be removed in idf v5.0
|
2020-01-07 23:50:03 -05:00
|
|
|
#elif CONFIG_IDF_TARGET_ESP32S2
|
|
|
|
#include "esp32s2/rom/ets_sys.h"
|
2020-07-31 06:26:07 -04:00
|
|
|
#elif CONFIG_IDF_TARGET_ESP32S3
|
|
|
|
#include "esp32s3/rom/ets_sys.h"
|
2020-11-26 00:10:21 -05:00
|
|
|
#elif CONFIG_IDF_TARGET_ESP32C3
|
|
|
|
#include "esp32c3/rom/ets_sys.h"
|
2021-06-10 03:22:43 -04:00
|
|
|
#elif CONFIG_IDF_TARGET_ESP32H2
|
|
|
|
#include "esp32h2/rom/ets_sys.h"
|
2021-11-06 05:23:21 -04:00
|
|
|
#elif CONFIG_IDF_TARGET_ESP8684
|
|
|
|
#include "esp8684/rom/ets_sys.h"
|
2020-01-07 23:50:03 -05:00
|
|
|
#endif
|
|
|
|
|
2020-07-21 01:07:34 -04:00
|
|
|
#define SOC_LOGE(tag, fmt, ...) esp_rom_printf("%s(err): " fmt, tag, ##__VA_ARGS__)
|
|
|
|
#define SOC_LOGW(tag, fmt, ...) esp_rom_printf("%s(warn): " fmt, tag, ##__VA_ARGS__)
|
|
|
|
#define SOC_LOGI(tag, fmt, ...) esp_rom_printf("%s(info): " fmt, tag, ##__VA_ARGS__)
|
|
|
|
#define SOC_LOGD(tag, fmt, ...) esp_rom_printf("%s(dbg): " fmt, tag, ##__VA_ARGS__)
|
|
|
|
#define SOC_LOGV(tag, fmt, ...) esp_rom_printf("%s: " fmt, tag, ##__VA_ARGS__)
|
2017-04-11 03:44:43 -04:00
|
|
|
#endif //ESP_PLATFORM
|