Skip to content
Snippets Groups Projects
Commit d3cd2b71 authored by Federico Pellegrin's avatar Federico Pellegrin
Browse files

sam0_common: fix sercom_id return value for SERCOM5 (#9875)

parent e8dfabd4
No related branches found
No related tags found
No related merge requests found
......@@ -299,7 +299,8 @@ static inline int sercom_id(void *sercom)
#if defined(CPU_FAM_SAMD21)
return ((((uint32_t)sercom) >> 10) & 0x7) - 2;
#elif defined(CPU_FAM_SAML21)
return ((((uint32_t)sercom) >> 10) & 0x7);
/* Left side handles SERCOM0-4 while right side handles unaligned address of SERCOM5 */
return ((((uint32_t)sercom) >> 10) & 0x7) + ((((uint32_t)sercom) >> 22) & 0x04);
#endif
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment