refactor(lpperi): improve compatibility solution

This commit is contained in:
laokaiyao
2025-01-15 17:02:34 +08:00
parent 4d11fe5847
commit 692ca37edf
10 changed files with 25 additions and 93 deletions

View File

@@ -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

View File

@@ -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) {
;
}
}