mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-10 12:53:29 +00:00
esp_system: introduce system time functions
- Introduce system time function and concept of system time provider. esp_timer is system time provider when present. - Set the reference point for system time, g_startup_time. - Use the system time functions in newlib instead of calling esp_timer functions directly
This commit is contained in:
@@ -97,7 +97,6 @@ static StaticQueue_t s_timer_semaphore_memory;
|
||||
static portMUX_TYPE s_timer_lock = portMUX_INITIALIZER_UNLOCKED;
|
||||
|
||||
|
||||
|
||||
esp_err_t esp_timer_create(const esp_timer_create_args_t* args,
|
||||
esp_timer_handle_t* out_handle)
|
||||
{
|
||||
@@ -349,7 +348,6 @@ static IRAM_ATTR bool is_initialized(void)
|
||||
return s_timer_task != NULL;
|
||||
}
|
||||
|
||||
|
||||
esp_err_t esp_timer_init(void)
|
||||
{
|
||||
esp_err_t err;
|
||||
@@ -380,6 +378,11 @@ esp_err_t esp_timer_init(void)
|
||||
goto out;
|
||||
}
|
||||
|
||||
err = esp_timer_timekeeping_impl_init();
|
||||
if (err != ESP_OK) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
return ESP_OK;
|
||||
|
||||
out:
|
||||
@@ -505,4 +508,4 @@ int64_t IRAM_ATTR esp_timer_get_next_alarm(void)
|
||||
}
|
||||
timer_list_unlock();
|
||||
return next_alarm;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user