From c4aa24c54e5fbb01e553b319b66bf84df9204b17 Mon Sep 17 00:00:00 2001 From: morris Date: Tue, 13 Sep 2022 15:54:05 +0800 Subject: [PATCH] rmt: disable rc_fast clock when it's used up --- components/driver/rmt/rmt_common.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/components/driver/rmt/rmt_common.c b/components/driver/rmt/rmt_common.c index 09911b729c..e3dc6ed448 100644 --- a/components/driver/rmt/rmt_common.c +++ b/components/driver/rmt/rmt_common.c @@ -74,6 +74,7 @@ rmt_group_t *rmt_acquire_group_handle(int group_id) void rmt_release_group_handle(rmt_group_t *group) { int group_id = group->group_id; + rmt_clock_source_t clk_src = group->clk_src; bool do_deinitialize = false; _lock_acquire(&s_platform.mutex); @@ -88,6 +89,16 @@ void rmt_release_group_handle(rmt_group_t *group) } _lock_release(&s_platform.mutex); + switch (clk_src) { +#if SOC_RMT_SUPPORT_RC_FAST + case RMT_CLK_SRC_RC_FAST: + periph_rtc_dig_clk8m_disable(); + break; +#endif // SOC_RMT_SUPPORT_RC_FAST + default: + break; + } + if (do_deinitialize) { ESP_LOGD(TAG, "del group(%d)", group_id); }