


	public void OS_run()
	{
		if( tDIR == 0 ) {
			return;
		}
		//判断是否使用加减速
		if( accel ) {
			
			if( runforever || addtime < time ) {
				if( realspeed < myspeed ) {
					realspeed + 1;
				}
			}
			else {
				if( time < dline ) {
					if( realspeed > 20 ) {
						realspeed - 1;
					}
				}
			}
			offset + realspeed;
		}
		else {
			offset + myspeed;
		}
		
		
		if( offset < 1000 ) {
			return;
		}
		offset - 1000;
		
		if( !runforever ) {
			if( time > 0 ) {
				time - 1;
			}
			else {
				tDIR = 0;
				return;
			}
		}
		addtime + 1;
		
		//加减速处理
		//int32 min = time;
		//if( min > addtime ) {
		//	min = addtime;
		//}
		//min = (int) ((uint)min << 2);
		//if( min > myspeed ) {
		//	min = myspeed;
		//}
		//if( min < 50 ) {
		//	min = 50;
		//}
		//realspeed = (int16)min;
		
		STEP.D0_OUT = 1;
		loop( 30 ) {}
		STEP.D0_OUT = 0;
	}
	
	