This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Bug in TimerPulseWidthSet function in StarterWare 1.20.03.03 for C6748

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.