/* Get the PWM duty of the PWM module. 
The  */
unsigned long xPWMDutyGet(unsigned long ulBase, unsigned long ulChannel)
/* Get the PWM duty of the PWM module. 
The  */
unsigned long xPWMDutyGet(unsigned long ulBase, unsigned long ulChannel)
{
    unsigned long ulChannelTemp;
    unsigned long ulCMRData;
    unsigned long ulCNRData;
    ulChannelTemp = (ulBase == PWMA_BASE) ? ulChannel : (ulChannel - 4);
    xASSERT((ulBase == PWMA_BASE) || (ulBase == PWMB_BASE));
    xASSERT(((ulChannelTemp >= 0) || (ulChannelTemp <= 3)));
    ulCNRData = (xHWREG(ulBase + PWM_CNR0 +(ulChannelTemp * 12)));
    ulCMRData = (xHWREG(ulBase + PWM_CMR0 +(ulChannelTemp * 12)));
    ulChannelTemp = (ulCMRData + 1) * 100 / (ulCNRData + 1);
    return ulChannelTemp;
}