mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-30 19:19:21 +00:00
esp32h2: add rtc clock support
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <freertos/FreeRTOS.h>
|
||||
#include "soc/clk_ctrl_os.h"
|
||||
#include "sdkconfig.h"
|
||||
|
||||
#define DELAY_RTC_CLK_SWITCH 5
|
||||
|
||||
@@ -19,7 +20,11 @@ bool periph_rtc_dig_clk8m_enable(void)
|
||||
portENTER_CRITICAL(&periph_spinlock);
|
||||
if (s_periph_ref_counts == 0) {
|
||||
rtc_dig_clk8m_enable();
|
||||
#if CONFIG_IDF_TARGET_ESP32H2
|
||||
s_rtc_clk_freq = rtc_clk_freq_cal(rtc_clk_cal(RTC_CAL_RC32K, 100));
|
||||
#else
|
||||
s_rtc_clk_freq = rtc_clk_freq_cal(rtc_clk_cal(RTC_CAL_8MD256, 100));
|
||||
#endif
|
||||
if (s_rtc_clk_freq == 0) {
|
||||
portEXIT_CRITICAL(&periph_spinlock);
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user