mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
sam0_common: correct sercom_set_gen for sercom5. it assumes SERCOM5 GEN clock is in sequence, but is not, need to put a specific if test
This commit is contained in:
parent
e8dfabd4c4
commit
bfdafe877e
@ -352,8 +352,13 @@ static inline void sercom_set_gen(void *sercom, uint32_t gclk)
|
||||
(SERCOM0_GCLK_ID_CORE + sercom_id(sercom)));
|
||||
while (GCLK->STATUS.reg & GCLK_STATUS_SYNCBUSY) {}
|
||||
#elif defined(CPU_FAM_SAML21)
|
||||
GCLK->PCHCTRL[SERCOM0_GCLK_ID_CORE + sercom_id(sercom)].reg =
|
||||
if (sercom_id(sercom) < 5) {
|
||||
GCLK->PCHCTRL[SERCOM0_GCLK_ID_CORE + sercom_id(sercom)].reg =
|
||||
(GCLK_PCHCTRL_CHEN | gclk);
|
||||
} else {
|
||||
GCLK->PCHCTRL[SERCOM5_GCLK_ID_CORE].reg =
|
||||
(GCLK_PCHCTRL_CHEN | gclk);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user