/* Set the PWM duty of the PWM module. 
The  */
void PWMDutySet(unsigned long ulBase, unsigned long ulChannel, unsigned char ulDuty)
/* Set the PWM duty of the PWM module. 
The  */
void PWMDutySet(unsigned long ulBase, unsigned long ulChannel, unsigned char ulDuty)
{
    unsigned long ulCMRData;
    xASSERT(PWMBaseValid(ulBase));
    xASSERT(((ulChannel >= 0) || (ulChannel <= 3)));
    xASSERT(((ulDuty > 0) || (ulDuty <= 100)));
    ulCMRData = (PWMARRGet(ulBase) *  ulDuty) / 100;
    if ((PWMARRGet(ulBase) *  ulDuty) / 100 == 0)
    {
        ulCMRData = 0;
    }
    xHWREG(ulBase + TIMER_CCR1 + ulChannel * 4) &= ~TIMER_CCR1_CCR1_M;
    xHWREG(ulBase + TIMER_CCR1 + ulChannel * 4) |= ulCMRData;
}