From a090b317131e8ae5cadb5b0105a4987bb3e51221 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sat, 16 Feb 2019 08:03:28 -0500 Subject: [PATCH] atsamd: Fix samd51 get_clock() sync bit check Signed-off-by: Kevin O'Connor --- src/atsamd/samd51_clock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/atsamd/samd51_clock.c b/src/atsamd/samd51_clock.c index bbeed416..363aa19e 100644 --- a/src/atsamd/samd51_clock.c +++ b/src/atsamd/samd51_clock.c @@ -23,7 +23,7 @@ static inline void gen_clock(uint32_t clkgen_id, uint32_t flags) { GCLK->GENCTRL[clkgen_id].reg = flags | GCLK_GENCTRL_GENEN; - while (GCLK->SYNCBUSY.reg & GCLK_SYNCBUSY_GENCTRL(clkgen_id)) + while (GCLK->SYNCBUSY.reg & GCLK_SYNCBUSY_GENCTRL(1 << clkgen_id)) ; }