change(soc): support xtal32k in esp32h4beta5

This commit is contained in:
hebinglin
2025-07-11 17:56:36 +08:00
parent ea2aaea88c
commit 88fb870346

View File

@@ -24,6 +24,7 @@
#include "esp_private/esp_pmu.h" #include "esp_private/esp_pmu.h"
#include "esp_rom_serial_output.h" #include "esp_rom_serial_output.h"
#include "esp_rom_sys.h" #include "esp_rom_sys.h"
#include "esp_sleep.h"
/* Number of cycles to wait from the 32k XTAL oscillator to consider it running. /* Number of cycles to wait from the 32k XTAL oscillator to consider it running.
* Larger values increase startup delay. Smaller values may cause false positive * Larger values increase startup delay. Smaller values may cause false positive
@@ -181,5 +182,9 @@ void rtc_clk_select_rtc_slow_clk(void)
*/ */
__attribute__((weak)) void esp_perip_clk_init(void) __attribute__((weak)) void esp_perip_clk_init(void)
{ {
ESP_EARLY_LOGW(TAG, "esp_perip_clk_init() has not been implemented yet"); soc_rtc_slow_clk_src_t rtc_slow_clk_src = rtc_clk_slow_src_get();
esp_sleep_pd_domain_t pu_domain = (esp_sleep_pd_domain_t)(\
(rtc_slow_clk_src == SOC_RTC_SLOW_CLK_SRC_XTAL32K) ? ESP_PD_DOMAIN_XTAL32K \
: ESP_PD_DOMAIN_MAX);
esp_sleep_pd_config(pu_domain, ESP_PD_OPTION_ON);
} }