mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-12 17:31:07 +00:00
feat(log): Refactoring timestamp APIs (move only)
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#include "esp_rom_sys.h"
|
||||
#include "esp_log_level.h"
|
||||
#include "esp_log_buffer.h"
|
||||
#include "esp_log_timestamp.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -37,45 +38,6 @@ typedef int (*vprintf_like_t)(const char *, va_list);
|
||||
*/
|
||||
vprintf_like_t esp_log_set_vprintf(vprintf_like_t func);
|
||||
|
||||
/**
|
||||
* @brief Function which returns timestamp to be used in log output
|
||||
*
|
||||
* This function is used in expansion of ESP_LOGx macros.
|
||||
* In the 2nd stage bootloader, and at early application startup stage
|
||||
* this function uses CPU cycle counter as time source. Later when
|
||||
* FreeRTOS scheduler start running, it switches to FreeRTOS tick count.
|
||||
*
|
||||
* For now, we ignore millisecond counter overflow.
|
||||
*
|
||||
* @return timestamp, in milliseconds
|
||||
*/
|
||||
uint32_t esp_log_timestamp(void);
|
||||
|
||||
/**
|
||||
* @brief Function which returns system timestamp to be used in log output
|
||||
*
|
||||
* This function is used in expansion of ESP_LOGx macros to print
|
||||
* the system time as "HH:MM:SS.sss". The system time is initialized to
|
||||
* 0 on startup, this can be set to the correct time with an SNTP sync,
|
||||
* or manually with standard POSIX time functions.
|
||||
*
|
||||
* Currently, this will not get used in logging from binary blobs
|
||||
* (i.e. Wi-Fi & Bluetooth libraries), these will still print the RTOS tick time.
|
||||
*
|
||||
* @return timestamp, in "HH:MM:SS.sss"
|
||||
*/
|
||||
char* esp_log_system_timestamp(void);
|
||||
|
||||
/**
|
||||
* @brief Function which returns timestamp to be used in log output
|
||||
*
|
||||
* This function uses HW cycle counter and does not depend on OS,
|
||||
* so it can be safely used after application crash.
|
||||
*
|
||||
* @return timestamp, in milliseconds
|
||||
*/
|
||||
uint32_t esp_log_early_timestamp(void);
|
||||
|
||||
/**
|
||||
* @brief Write message into the log
|
||||
*
|
||||
|
Reference in New Issue
Block a user