On Thu, 23 Oct 2025 16:47:17 +0000
Chris Brandt <[email protected]> wrote:
> Hi Hugo,
>
> On Wed, Oct 22, 2025 9:49 PM, Hugo Villeneuve wrote:
>
> > > + for (params->pl5_postdiv1 = PLL5_POSTDIV_MIN;
> > > + params->pl5_postdiv1 < PLL5_POSTDIV_MAX + 1;
> >
> > I think it would be easier to read/understand like this:
> > params->pl5_postdiv1 <= PLL5_POSTDIV_MAX;
> >
> > > + params->pl5_postdiv1++) {
> > > + for (params->pl5_postdiv2 = PLL5_POSTDIV_MIN;
> > > + params->pl5_postdiv2 < PLL5_POSTDIV_MAX + 1;
> >
> > Ditto
>
> OK. I can agree with that.
If you do that, you can also probably put this if() on as single line
to improve readability:
if (foutvco_rate <= PLL5_FOUTVCO_MIN ||
foutvco_rate >= PLL5_FOUTVCO_MAX)
>
>
> > > + params->pl5_fracin = div_u64(((u64)
> > > + (foutvco_rate *
> > > params->pl5_refdiv) %
> > > + (EXTAL_FREQ_IN_MEGA_HZ *
> > > MEGA)) << 24,
> > > + EXTAL_FREQ_IN_MEGA_HZ *
> > > MEGA);
> > > +
> > > + params->pl5_fracin = div_u64((u64)
> > > + ((foutvco_rate *
> > > params->pl5_refdiv) %
> > > + (EXTAL_FREQ_IN_MEGA_HZ *
> > > MEGA)) << 24,
> > > + EXTAL_FREQ_IN_MEGA_HZ *
> > > MEGA);
> >
> > Remove second identical block?
>
> Wow! How did that get in there????
>
> Thanks !
>
> I'll wait a little to see if there are any other comments, then I'll send V4
>
>
> Chris
>
--
Hugo Villeneuve