
//射频卡模块

//修改时间: 2014年11月3日 晚上11:43
//下午北京的两个朋友过来聊产品, 我这边没带电脑, 于是在下边聊了会儿, 6点多了才去6楼用我的台式机
//展示. 其中弄了一个射频卡控制小喇叭蜂鸣, 结果程序卡住了! 换了别的程序...
//晚上回来不死心, 继续调试, 偶然发现把一个数组定义到全局变量就行了... 哎...
//需要找时间好好分析下到底为什么...


unit MFRC522
{
	public const uint16 ID = 0;
	
	public link unit CS {}
	public link unit SCK {}
	public link unit MOSI {}
	public link unit MISO {}
	
	#include "$run$.txt"
	
	//[i] var_uint8 OS_time;
	public uint8 OS_time;
	
	//[i] var_uint32 OS_EventFlag;
	public uint32 OS_EventFlag;
	
	//[i] event enter_event;
	//[i] event leave_event;
	
	//[i] var_bool isNear;
	public bool isNear;
	
	//[i] var_int32 IDnumber;
	int32 IDnumber;
	
	//[i] var_Cstring IDlist;
	[uint8*9] IDlist;
	
	
	
	//---------------------------------------------------
	//初始化
	//[i] function_void OS_init;
	public void OS_init()
	{
		RunInit();
		
		OS_EventFlag = 0;
		OS_time = 100;
		
		isNear = false;
		
		IDlist[0] = 0;
		IDlist[8] = 0;
		IDnumber = 0;
	}
	//---------------------------------------------------
	//测试
	//[i] function_void OS_run;
	
	//[i] function_int32 test;
	
	//...
}


