From ec594e2c6f88f75aff9da4d9053950e49b7a0ec3 Mon Sep 17 00:00:00 2001 From: Konstantin Kondrashov Date: Thu, 2 May 2024 12:36:32 +0300 Subject: [PATCH] feat(log): Refactoring lock APIs --- components/log/CMakeLists.txt | 16 +++++----------- components/log/linker.lf | 1 + .../log/{log_linux.c => src/linux/log_lock.c} | 0 .../log/{log_noos.c => src/noos/log_lock.c} | 0 .../log/{log_freertos.c => src/os/log_lock.c} | 0 5 files changed, 6 insertions(+), 11 deletions(-) rename components/log/{log_linux.c => src/linux/log_lock.c} (100%) rename components/log/{log_noos.c => src/noos/log_lock.c} (100%) rename components/log/{log_freertos.c => src/os/log_lock.c} (100%) diff --git a/components/log/CMakeLists.txt b/components/log/CMakeLists.txt index a3cbd5d097..e162bfb853 100644 --- a/components/log/CMakeLists.txt +++ b/components/log/CMakeLists.txt @@ -11,20 +11,14 @@ else() endif() set(srcs "src/${system_target}/log_timestamp.c" - "src/log_timestamp_common.c") + "src/log_timestamp_common.c" + "src/${system_target}/log_lock.c") set(priv_requires "") -if(BOOTLOADER_BUILD) - list(APPEND srcs "log_noos.c") -else() - list(APPEND srcs "src/os/log_write.c") +if(NOT BOOTLOADER_BUILD) + list(APPEND priv_requires soc hal esp_hw_support) - if(${target} STREQUAL "linux") - list(APPEND srcs "log_linux.c") - else() - list(APPEND srcs "log_freertos.c") - list(APPEND priv_requires soc hal esp_hw_support) - endif() + list(APPEND srcs "src/os/log_write.c") # Buffer APIs call ESP_LOG_LEVEL -> esp_log_write, which can not used in bootloader. list(APPEND srcs "src/buffer/log_buffers.c" diff --git a/components/log/linker.lf b/components/log/linker.lf index 0a9e476b26..5339affc8c 100644 --- a/components/log/linker.lf +++ b/components/log/linker.lf @@ -4,3 +4,4 @@ entries: log_write:esp_log_write (noflash) log_timestamp:esp_log_timestamp (noflash) log_timestamp:esp_log_early_timestamp (noflash) + log_lock (noflash) diff --git a/components/log/log_linux.c b/components/log/src/linux/log_lock.c similarity index 100% rename from components/log/log_linux.c rename to components/log/src/linux/log_lock.c diff --git a/components/log/log_noos.c b/components/log/src/noos/log_lock.c similarity index 100% rename from components/log/log_noos.c rename to components/log/src/noos/log_lock.c diff --git a/components/log/log_freertos.c b/components/log/src/os/log_lock.c similarity index 100% rename from components/log/log_freertos.c rename to components/log/src/os/log_lock.c