change(build): Add a new CMake flag NON_OS_BUILD for non-FreeRTOS builds

This commit is contained in:
Laukik Hase
2024-10-16 13:32:12 +05:30
parent 12398c0f25
commit 5328dcd00c
17 changed files with 46 additions and 30 deletions
+3 -2
View File
@@ -1,6 +1,7 @@
idf_build_get_property(target IDF_TARGET)
idf_build_get_property(non_os_build NON_OS_BUILD)
if(BOOTLOADER_BUILD)
if(non_os_build)
set(system_target "noos")
else()
if(${target} STREQUAL "linux")
@@ -15,7 +16,7 @@ set(srcs "src/${system_target}/log_timestamp.c"
"src/${system_target}/log_lock.c")
set(priv_requires "")
if(NOT BOOTLOADER_BUILD)
if(NOT non_os_build)
list(APPEND priv_requires soc hal esp_hw_support)
list(APPEND srcs "src/os/log_write.c")
+2 -2
View File
@@ -101,7 +101,7 @@ void esp_log_writev(esp_log_level_t level, const char* tag, const char* format,
esp_rom_printf(LOG_FORMAT(log_tag_letter, format), esp_log_timestamp(), tag, ##__VA_ARGS__); \
}} while(0)
#ifndef BOOTLOADER_BUILD
#ifndef NON_OS_BUILD
#if defined(__cplusplus) && (__cplusplus > 201703L)
#define ESP_LOGE( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_ERROR, tag, format __VA_OPT__(,) __VA_ARGS__)
#define ESP_LOGW( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_WARN, tag, format __VA_OPT__(,) __VA_ARGS__)
@@ -147,7 +147,7 @@ void esp_log_writev(esp_log_level_t level, const char* tag, const char* format,
/// macro to output logs at ``ESP_LOG_VERBOSE`` level. @see ``ESP_LOGE``
#define ESP_LOGV( tag, format, ... ) ESP_EARLY_LOGV(tag, format, ##__VA_ARGS__)
#endif // !(defined(__cplusplus) && (__cplusplus > 201703L))
#endif // BOOTLOADER_BUILD
#endif // !NON_OS_BUILD
/** runtime macro to output logs at a specified level.
*
+2 -2
View File
@@ -13,7 +13,7 @@
extern "C" {
#endif
#if !BOOTLOADER_BUILD || __DOXYGEN__
#if !NON_OS_BUILD || __DOXYGEN__
/**
* @brief Logs a buffer of hexadecimal bytes at the specified log level.
@@ -173,7 +173,7 @@ static inline void esp_log_buffer_char(const char *tag, const void *buffer, uint
}
/** @endcond */
#endif // !BOOTLOADER_BUILD || __DOXYGEN__
#endif // !NON_OS_BUILD || __DOXYGEN__
#ifdef __cplusplus
}
+3 -3
View File
@@ -37,12 +37,12 @@ typedef enum {
#endif // !BOOTLOADER_BUILD
#endif // LOG_LOCAL_LEVEL
#if BOOTLOADER_BUILD
#ifdef NON_OS_BUILD
#define _ESP_LOG_ENABLED(log_level) (LOG_LOCAL_LEVEL >= (log_level))
#define _ESP_LOG_EARLY_ENABLED(log_level) _ESP_LOG_ENABLED(log_level)
#else // !BOOTLOADER_BUILD
#else // !NON_OS_BUILD
#if CONFIG_LOG_MASTER_LEVEL
#define _ESP_LOG_ENABLED(log_level) (esp_log_get_level_master() >= (log_level) && LOG_LOCAL_LEVEL >= (log_level))
@@ -54,7 +54,7 @@ typedef enum {
currently configured min log level are higher than the log level */
#define _ESP_LOG_EARLY_ENABLED(log_level) (LOG_LOCAL_LEVEL >= (log_level) && esp_log_get_default_level() >= (log_level))
#endif // !BOOTLOADER_BUILD
#endif // !NON_OS_BUILD
/** @endcond */
+2 -2
View File
@@ -12,7 +12,7 @@
#include "esp_private/log_timestamp.h"
#include "sdkconfig.h"
#if !BOOTLOADER_BUILD
#ifndef NON_OS_BUILD
#include <sys/lock.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
@@ -60,7 +60,7 @@ char *esp_log_system_timestamp(void)
}
return buffer;
}
#endif // !BOOTLOADER_BUILD
#endif // !NON_OS_BUILD
uint64_t esp_log_timestamp64(bool critical)
{