Merge branch 'refactor/improve_the_compatible_method_on_h2' into 'master'

refactor(lpperi): improve compatibility solution

See merge request espressif/esp-idf!36408
This commit is contained in:
Kevin (Lao Kaiyao)
2025-01-16 00:07:56 +08:00
10 changed files with 25 additions and 93 deletions
@@ -63,7 +63,7 @@ static inline void lp_clkrst_ll_select_modem_32k_clock_source(lp_clkrst_dev_t *h
__attribute__((always_inline))
static inline void _lp_clkrst_ll_enable_rng_clock(bool en)
{
LPPERI.clk_en->rng_ck_en = en;
LPPERI_REG_SET(clk_en.rng_ck_en, en);
}
/// LPPERI.clk_en is a shared register, so this function must be used in an atomic way
@@ -38,8 +38,8 @@ typedef enum {
*/
static inline void _rtcio_ll_enable_io_clock(bool enable)
{
LPPERI.clk_en->lp_io_ck_en = enable;
while (LPPERI.clk_en->lp_io_ck_en != enable) {
LPPERI_REG_SET(clk_en.lp_io_ck_en, enable);
while (LPPERI_REG_GET(clk_en.lp_io_ck_en) != enable) {
;
}
}