fix(hal): fix the issue of dual-core contention for RTC_CNTL regs

This commit is contained in:
hebinglin
2026-03-02 14:39:00 +08:00
parent c59aab9a07
commit e16933fdcb
23 changed files with 258 additions and 57 deletions
@@ -49,7 +49,7 @@ extern "C" {
* @note User code protected by this macro should be as short as possible, because it's a critical section
*/
#define PERIPH_RCC_ATOMIC() \
for (int _rc_cnt = 1, __DECLARE_RCC_ATOMIC_ENV; \
for (int _rc_cnt = 1, __DECLARE_RCC_ATOMIC_ENV __attribute__((unused)); \
_rc_cnt ? (periph_rcc_enter(), 1) : 0; \
periph_rcc_exit(), _rc_cnt--)