Hello,
The pulseWidth parameter is not being used in this function.
void TimerPulseWidthSet(unsigned int baseAddr, unsigned int timer,
unsigned int pulseWidth)
{
/* Clear the bits for Pulse width selection */
HWREG(baseAddr + TMR_TCR) &= ~(timer & (TMR_TCR_PWID34 |
TMR_TCR_PWID12));
/* Set the pulse width for the appropriate timer */
HWREG(baseAddr + TMR_TCR) |= (timer & (TMR_TCR_PWID34 |
TMR_TCR_PWID12));
}
I think the correct form should be:
void TimerPulseWidthSet(unsigned int baseAddr, unsigned int timer,
unsigned int pulseWidth)
{
/* Clear the bits for Pulse width selection */
HWREG(baseAddr + TMR_TCR) &= ~(timer & (TMR_TCR_PWID34 |
TMR_TCR_PWID12));
/* Set the pulse width for the appropriate timer */
HWREG(baseAddr + TMR_TCR) |= (timer & (pulseWidth & (TMR_TCR_PWID34 |
TMR_TCR_PWID12)));
}
Best regards,
David.