/* Control the 42BYGH step motor roll direction and speed.  */
void MSStepMotorRun(unsigned long ulDir, unsigned long ulSteps)
/* Control the 42BYGH step motor roll direction and speed.  */
void MSStepMotorRun(unsigned long ulDir, unsigned long ulSteps)
{
    unsigned long i, j;
    xASSERT((ulDir == MS_RUN_FORWARD) || 
	        (ulDir == MS_RUN_BACKWARD));
    if(ulDir == MS_RUN_FORWARD)
	{
	    for(j = 0; j < ulSteps; j++)
		{
	        for(i = 0; i < 8; i++)
		    {
		        MS74HC595DataSend(g_ul42BYGHForward[g_ul42BYGHStepper][i]);
			    MSDelay(g_ulStepsDelay);
		    }
		}
	}
	else
	{
	    for(j = 0; j < ulSteps; j++)
		{
	        for(i = 0; i < 8; i++)
		    {
		        MS74HC595DataSend(g_ul42BYGHReversal[g_ul42BYGHStepper][i]);
			    MSDelay(g_ulStepsDelay);
		    }
		}
	}
}