diff --git a/components/esp_common/include/esp_private/system_internal.h b/components/esp_common/include/esp_private/system_internal.h index fcbd250dc1..4f5c90e817 100644 --- a/components/esp_common/include/esp_private/system_internal.h +++ b/components/esp_common/include/esp_private/system_internal.h @@ -61,10 +61,20 @@ void esp_reset_reason_set_hint(esp_reset_reason_t hint); */ esp_reset_reason_t esp_reset_reason_get_hint(void); + /** * @brief Get the time in microseconds since startup + * + * @returns time since startup in microseconds */ +int64_t esp_system_get_time(void); +/** + * @brief Get the resolution of the time returned by `esp_system_get_time`. + * + * @returns the resolution in microseconds + */ +uint32_t esp_system_get_time_resolution(void); #ifdef __cplusplus } diff --git a/components/esp_system/include/esp_system.h b/components/esp_system/include/esp_system.h index 94a2355425..9be72c3e07 100644 --- a/components/esp_system/include/esp_system.h +++ b/components/esp_system/include/esp_system.h @@ -286,19 +286,6 @@ typedef struct { */ void esp_chip_info(esp_chip_info_t* out_info); -/** - * @brief Get the time in microseconds since startup - * - * @returns time since startup in microseconds - */ -int64_t esp_system_get_time(void); - -/** - * @brief Get the resolution of the time returned by `esp_system_get_time`. - * - * @returns the resolution in microseconds - */ -uint32_t esp_system_get_time_resolution(void); #if CONFIG_ESP32_ECO3_CACHE_LOCK_FIX /** diff --git a/components/esp_timer/src/esp_timer.c b/components/esp_timer/src/esp_timer.c index c0f14b2d1f..a1d870c6d0 100644 --- a/components/esp_timer/src/esp_timer.c +++ b/components/esp_timer/src/esp_timer.c @@ -30,6 +30,7 @@ #include "esp_private/startup_internal.h" #include "esp_private/esp_timer_private.h" +#include "esp_private/system_internal.h" #if CONFIG_IDF_TARGET_ESP32 #include "esp32/rtc.h" diff --git a/components/newlib/port/esp_time_impl.c b/components/newlib/port/esp_time_impl.c index 35281aadc5..b8fb85d9cf 100644 --- a/components/newlib/port/esp_time_impl.c +++ b/components/newlib/port/esp_time_impl.c @@ -21,6 +21,8 @@ #include "soc/rtc.h" #include "esp_rom_sys.h" +#include "esp_private/system_internal.h" + #include "esp_time_impl.h" #include "sdkconfig.h" diff --git a/components/newlib/time.c b/components/newlib/time.c index 909963277f..d8f8173436 100644 --- a/components/newlib/time.c +++ b/components/newlib/time.c @@ -28,6 +28,8 @@ #include "freertos/FreeRTOS.h" #include "freertos/task.h" +#include "esp_private/system_internal.h" + #include "soc/spinlock.h" #include "soc/rtc.h"