Hello,
I have a strange behavior while executing this line of code:
div = (float)(ClkCfgRegs.SYSCLKDIVSEL.bit.PLLSYSCLKDIV << 1);
when I step over this line, variable div is 4.0
when I execute this line of code after
sysclkToInClkError = ((mult / div) - ((float) ctr1 / (float) dTMR2_INP_CLK_CTR));
the div changes, it must remain unchanged but div = 8.93...
could you figure out what is the problem please,
the complete is the following:
mult = (float) (pCfg->kCC.u16SysPllMult_Imult) + (float) (pCfg->kCC.u16SysPllMult_Fmult) / 4;
if (!ClkCfgRegs.SYSCLKDIVSEL.bit.PLLSYSCLKDIV)
{
div = 1;
}
else
{
div = (float)(ClkCfgRegs.SYSCLKDIVSEL.bit.PLLSYSCLKDIV << 1);
}
/* compute the error */
sysclkToInClkError = ((mult / div) - ((float) ctr1 / (float) dTMR2_INP_CLK_CTR));
Regards,
S.Tarik
