esp_timer: perform initialization using ESP_SYSTEM_INIT_FN

(startup.c still calls esp_timer_early_init directly)
This commit is contained in:
Ivan Grokhotkov 2022-05-18 01:14:42 +02:00
parent 42654927d5
commit bb771fb7c4
No known key found for this signature in database
GPG Key ID: 1E050E141B280628
3 changed files with 8 additions and 2 deletions

View File

@ -447,8 +447,6 @@ static void start_cpu0_default(void)
ESP_SYSTEM_INIT_FN(init_components0, BIT(0), 200)
{
esp_timer_init();
#if CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND && !CONFIG_PM_SLP_DISABLE_GPIO
// Configure to isolate (disable the Input/Output/Pullup/Pulldown
// function of the pin) all GPIO pins in sleep state

View File

@ -13,6 +13,9 @@
# affinity_expression: bit map of cores the function is executed on
# esp_timer has to be initialized early, since it is used by several other components
100: esp_timer_startup_init in components/esp_timer/src/esp_timer.c on BIT(0)
# the rest of the components which are initialized from startup.c
# [refactor-todo]: move init calls into respective components
200: init_components0 in components/esp_system/startup.c on BIT(0)

View File

@ -460,6 +460,11 @@ out:
return ESP_ERR_NO_MEM;
}
ESP_SYSTEM_INIT_FN(esp_timer_startup_init, BIT(0), 100)
{
return esp_timer_init();
}
esp_err_t esp_timer_deinit(void)
{
if (!is_initialized()) {