Merge branch 'refactor/newlib-time-init-to-esp-libc' into 'master'

refactor(esp_libc): move newlib time init into esp_libc component

Closes IDF-8756

See merge request espressif/esp-idf!47506
This commit is contained in:
Marius Vikhammer
2026-04-13 23:52:01 +08:00
3 changed files with 8 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2024-2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -24,6 +24,12 @@ ESP_SYSTEM_INIT_FN(init_libc_stdio, CORE, BIT(0), 120)
return ESP_OK;
}
ESP_SYSTEM_INIT_FN(init_libc_time, CORE, BIT(0), 106)
{
esp_libc_time_init();
return ESP_OK;
}
// Hook to force the linker to include this file
void esp_libc_init_funcs(void)
{

View File

@@ -13,7 +13,6 @@
#include "esp_check.h"
#include "esp_system.h"
#include "esp_log.h"
#include "esp_newlib.h"
#include "esp_xt_wdt.h"
#include "esp_cpu.h"
#include "esp_private/startup_internal.h"
@@ -91,12 +90,6 @@ ESP_SYSTEM_INIT_FN(init_brownout, CORE, BIT(0), 105)
}
#endif
ESP_SYSTEM_INIT_FN(init_newlib_time, CORE, BIT(0), 106)
{
esp_libc_time_init();
return ESP_OK;
}
#if CONFIG_ESP_XT_WDT
ESP_SYSTEM_INIT_FN(init_xt_wdt, CORE, BIT(0), 170)
{

View File

@@ -50,7 +50,7 @@ CORE: 102: init_libc in components/esp_libc/src/init.c on BIT(0)
CORE: 103: psram_core_stage_init in components/esp_psram/system_layer/esp_psram.c on BIT(0)
CORE: 105: init_brownout in components/esp_system/startup_funcs.c on BIT(0)
CORE: 106: init_newlib_time in components/esp_system/startup_funcs.c on BIT(0)
CORE: 106: init_libc_time in components/esp_libc/src/init.c on BIT(0)
# Peripheral-specific implementation operators should be filled first
# Then register vfs console, and follow by esp_libc stdio initialization