diff --git a/src/rp2040/main.c b/src/rp2040/main.c index 97fa5eb8..40869618 100644 --- a/src/rp2040/main.c +++ b/src/rp2040/main.c @@ -113,8 +113,8 @@ static void pll_setup(pll_hw_t *pll, uint32_t mul, uint32_t postdiv) { // Setup pll - uint32_t refdiv = 1, fbdiv = mul, postdiv2 = 2, postdiv1 = postdiv/postdiv2; - if (postdiv1 > 0x07) { + uint32_t refdiv = 1, fbdiv = mul, postdiv2 = 1, postdiv1 = postdiv; + while (postdiv1 > 0x07) { postdiv1 >>= 1; postdiv2 <<= 1; }