fix: change the api to enable rc32k on ESP32-H2

This commit is contained in:
cjin
2025-09-29 15:25:51 +08:00
parent cab6f108e9
commit 7dd4252bc4
+5 -2
View File
@@ -18,6 +18,9 @@
#include "esp_sleep.h"
#include "hal/efuse_hal.h"
#include "hal/clk_tree_ll.h"
#if CONFIG_IDF_TARGET_ESP32H2
#include "soc/rtc.h"
#endif // CONFIG_IDF_TARGET_ESP32H2
// Please define the frequently called modules in the low bit,
// which will improve the execution efficiency
@@ -369,7 +372,7 @@ void modem_clock_select_lp_clock_source(periph_module_t module, modem_clock_lpcl
if (selected) {
rc_clk_en = clk_ll_rc32k_is_enabled();
if (!rc_clk_en) {
clk_ll_rc32k_enable();
rtc_clk_rc32k_enable(true);
}
modem_clock_hal_select_ble_rtc_timer_lpclk_source(MODEM_CLOCK_instance()->hal, MODEM_CLOCK_LPCLK_SRC_RC32K);
}
@@ -382,7 +385,7 @@ void modem_clock_select_lp_clock_source(periph_module_t module, modem_clock_lpcl
if (!rc_clk_en) {
extern void r_esp_ble_rtc_ticks_delay(uint32_t ticks);
r_esp_ble_rtc_ticks_delay(2);
clk_ll_rc32k_disable();
rtc_clk_rc32k_enable(false);
}
#endif // CONFIG_IDF_TARGET_ESP32H2
#if SOC_BLE_USE_WIFI_PWR_CLK_WORKAROUND