/* Set the PWM duty of the PWM module. 
The  */
void xPWMDutySet(unsigned long ulBase, unsigned long ulChannel, unsigned char ulDuty)
/* Set the PWM duty of the PWM module. 
The  */
void xPWMDutySet(unsigned long ulBase, unsigned long ulChannel, unsigned char ulDuty)
{
    unsigned long ulCMRData;
    xASSERT(ulBase == PWMA_BASE);
    xASSERT(((ulChannel >= 0) || (ulChannel <= 1)));
    xASSERT(((ulDuty > 0) || (ulDuty <= 100)));
    ulCMRData = (xHWREG(ulBase + PWM_CNR0 +(ulChannel * 12)) + 1) * 
                ulDuty / 100 - 1;
    if ((xHWREG(ulBase + PWM_CNR0 +(ulChannel * 12)) + 1) *ulDuty / 100 == 0)
    {
        ulCMRData = 0;
    }
    xHWREG(ulBase + PWM_CMR0 +(ulChannel * 12)) = ulCMRData;
}