1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2026-01-01 01:41:18 +01:00

cpu/cc2538/timer: fix GPT enabling wait

This commit is contained in:
Francisco Molina 2020-03-25 20:16:23 +01:00
parent ab5deca3b0
commit dcd6b7f226
No known key found for this signature in database
GPG Key ID: 3E94EAC3DBDEEDA8

View File

@ -144,9 +144,9 @@ static inline void _timer_clock_enable(tim_t tim)
in PM1-3) */
SYS_CTRL->DCGCGPT |= (1UL << tim);
/* wait for the clock enabling to take effect */
while (!(SYS_CTRL->RCGCGPT &= (1UL << tim)) || \
!(SYS_CTRL->SCGCGPT &= (1UL << tim)) || \
!(SYS_CTRL->DCGCGPT &= (1UL << tim))
while (!(SYS_CTRL->RCGCGPT & (1UL << tim)) || \
!(SYS_CTRL->SCGCGPT & (1UL << tim)) || \
!(SYS_CTRL->DCGCGPT & (1UL << tim))
) {}
/* set pending timers */
@ -165,9 +165,9 @@ static inline void _timer_clock_disable(tim_t tim)
in PM1-3) */
SYS_CTRL->DCGCGPT &= ~(1UL << tim);
/* Wait for the clock gating to take effect */
while ((SYS_CTRL->RCGCGPT &= (1UL << tim)) || \
(SYS_CTRL->SCGCGPT &= (1UL << tim)) || \
(SYS_CTRL->DCGCGPT &= (1UL << tim))
while ((SYS_CTRL->RCGCGPT & (1UL << tim)) || \
(SYS_CTRL->SCGCGPT & (1UL << tim)) || \
(SYS_CTRL->DCGCGPT & (1UL << tim))
) {}
}