
	void RunInit()
	{
		H595.init();
		H595.send_2_byte( NO_SELECT, NO_SEG );
	}
	void OS_run()
	{
		uint8 s = point >> current_index;
		
		uint8 seg_data = data_show[current_index];
		seg_data.7(bit) = s.0(bit);
		
		//显示当前位的数据
		H595.send_2_byte( current_select, seg_data );
		current_select << 1;
		current_index + 1;
		if( current_index == 4 ) reset();
	}
	//==============================================
	H595.DATA_IN = DATA_IN; H595.DATA_OUT = DATA_OUT; H595.DATA_DIR = DATA_DIR;
	H595.LOCK_IN = LOCK_IN; H595.LOCK_OUT = LOCK_OUT; H595.LOCK_DIR = LOCK_DIR;
	H595.SHIFT_IN = SHIFT_IN; H595.SHIFT_OUT = SHIFT_OUT; H595.SHIFT_DIR = SHIFT_DIR;
	
	unit H595
	{
		public link bit DATA_IN; public link bit DATA_OUT; public link bit DATA_DIR;
		public link bit LOCK_IN; public link bit LOCK_OUT; public link bit LOCK_DIR;
		public link bit SHIFT_IN; public link bit SHIFT_OUT; public link bit SHIFT_DIR;
		
		//==============================================
		public void init()
		{
			DATA_DIR = 1;
			DATA_OUT = 0;
			SHIFT_DIR = 1;
			SHIFT_OUT = 0;
			LOCK_DIR = 1;
			LOCK_OUT = 0;
		}
		//==============================================
		//发送一组数据--包含片选和对应的字形代码
		public void send_2_byte( uint8 select, uint8 data )
		{
			send_byte( data );
			send_byte( ~select );
			LOCK_OUT = 1;
			LOCK_OUT = 0;
		}
		//==============================================
		void send_byte( uint8 data )
		{
			loop( 8 ) {
				DATA_OUT = data.7(bit);
				data << 1;
				SHIFT_OUT = 1;
				SHIFT_OUT = 0;
			}
		}
	}
	
	void DateRefresh()
	{
		
	}
	
	
	
	