

	//=================================================================================
	
	void RunInit()
	{
		X0.OutputMode();
		X1.OutputMode();
		X2.OutputMode();
		X3.OutputMode();
		X4.OutputMode();
		X5.OutputMode();
		X6.OutputMode();
		X7.OutputMode();
		
		X0.D0_OUT = 0;
		X1.D0_OUT = 0;
		X2.D0_OUT = 0;
		X3.D0_OUT = 0;
		X4.D0_OUT = 0;
		X5.D0_OUT = 0;
		X6.D0_OUT = 0;
		X7.D0_OUT = 0;
		
		Y0.OutputMode();
		Y1.OutputMode();
		Y2.OutputMode();
		Y3.OutputMode();
		Y4.OutputMode();
		Y5.OutputMode();
		Y6.OutputMode();
		Y7.OutputMode();
		
		Y0.D0_OUT = 1;
		Y1.D0_OUT = 1;
		Y2.D0_OUT = 1;
		Y3.D0_OUT = 1;
		Y4.D0_OUT = 1;
		Y5.D0_OUT = 1;
		Y6.D0_OUT = 1;
		Y7.D0_OUT = 1;
	}
	public void OS_run()
	{
		uint8 seg_data = data_show[current_index];
		
		//显示当前位的数据
		send_2_byte( seg_data, current_select );
		current_select >> 1;
		current_index + 1;
		if( current_index == 8 ) reset();
	}
	void DataChanged()
	{
		data_show[0] = data[7];
		data_show[1] = data[6];
		data_show[2] = data[5];
		data_show[3] = data[4];
		data_show[4] = data[3];
		data_show[5] = data[2];
		data_show[6] = data[1];
		data_show[7] = data[0];
	}
	//=================================================================================
	void reset()
	{
		current_index = 0;
		current_select = SELECT_DATA0;
	}
	void send_2_byte( uint8 d, uint8 select )
	{
		select = ~select;
		
		X0.D0_OUT = 1;
		X1.D0_OUT = 1;
		X2.D0_OUT = 1;
		X3.D0_OUT = 1;
		X4.D0_OUT = 1;
		X5.D0_OUT = 1;
		X6.D0_OUT = 1;
		X7.D0_OUT = 1;
		
		Y0.D0_OUT = d.0(bit);
		Y1.D0_OUT = d.1(bit);
		Y2.D0_OUT = d.2(bit);
		Y3.D0_OUT = d.3(bit);
		Y4.D0_OUT = d.4(bit);
		Y5.D0_OUT = d.5(bit);
		Y6.D0_OUT = d.6(bit);
		Y7.D0_OUT = d.7(bit);
		
		X0.D0_OUT = select.0(bit);
		X1.D0_OUT = select.1(bit);
		X2.D0_OUT = select.2(bit);
		X3.D0_OUT = select.3(bit);
		X4.D0_OUT = select.4(bit);
		X5.D0_OUT = select.5(bit);
		X6.D0_OUT = select.6(bit);
		X7.D0_OUT = select.7(bit);
	}
	
	
	
	
	
	
