feat(esp_timer): Move esp_timer-related init steps into the component

This commit is contained in:
Konstantin Kondrashov
2024-01-23 20:10:20 +02:00
committed by BOT
parent 10f14d5cca
commit 49ba674fb5
11 changed files with 80 additions and 50 deletions

View File

@@ -0,0 +1,35 @@
/*
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "esp_private/startup_internal.h"
#include "esp_timer_impl.h"
#include "sdkconfig.h"
esp_err_t esp_timer_early_init(void)
{
esp_timer_impl_early_init();
#if CONFIG_ESP_TIME_FUNCS_USE_ESP_TIMER
esp_timer_impl_init_system_time();
#endif
return ESP_OK;
}
/*
* This function starts a timer, which is used by esp_timer
* to count time from the very start of the application.
*
* Another initialization function, esp_timer_init_nonos (which initializes ISR and task),
* is called only if other code calls the esp_timer API.
*/
ESP_SYSTEM_INIT_FN(esp_timer_init_nonos, CORE, BIT(0), 101)
{
return esp_timer_early_init();
}
void esp_timer_init_include_func(void)
{
// Hook to force the linker to include this file
}