/* Configure the PWM frecqurecy and output duty cycle. 
The  */
void AMSDCMotorRun(unsigned long ulMotor, unsigned long ulDir)
/* Configure the PWM frecqurecy and output duty cycle. 
The  */
void AMSDCMotorRun(unsigned long ulMotor, unsigned long ulDir)
{
    xASSERT((ulBase == AMS_MOTOR_A) ||
	        (ulBase == AMS_MOTOR_B));
    xASSERT((ulDir == AAMS_RUN_FORWARD) ||
			(ulDir == AMS_RUN_BACKWARD));
    if(ulMotor == AMS_MOTOR_A)
	{
    	xGPIOSPinWrite(sD12,ulDir);
    	xGPIOSPinWrite(sD9,0);
    	xPWMStart(sPWMB_BASE, xPWM_CHANNEL0);
	}
	else if(ulMotor == AMS_MOTOR_B)
	{
    	xGPIOSPinWrite(sD13,ulDir);
    	xGPIOSPinWrite(sD8,0);
    	xPWMStart(sPWMA_BASE, xPWM_CHANNEL2);
	}
}