regarding line 123 (and similarly lines 194 & 264): failCode = disable_plls(SYS_CLKSRC_PLL1 | SYS_CLKSRC_PLL2);
Doesn't this throw away errors in the slip-detect loop directly above it?
Shouldn't it instead be: failCode |= disable_plls(SYS_CLKSRC_PLL1); ?
Regards,
Mark