⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 list.h

📁 一个流量控制仪器的源码
💻 H
字号:
/************************************************************************************/
/* G7000 V3 列表管理											*/
/* MCU 型号: Philips P89C668														*/
/* 时钟频率: 11.0592 MHz	6 CLOCK														    */
/* 开发环境: Keil C51 V7.06a															*/
/* 开发日期: 2004.02.25													        	*/
/* 程序编写: BaoFang  鲍方															*/
/* 系统版本: V3.00																	*/
/************************************************************************************/



#ifdef uchar 
  #define READYDEF_uchar 1   /*宏uchar已定义*/
#else  
  #define uchar unsigned char
#endif

#ifdef uint 
  #define READYDEF_uint 1   /*宏uint已定义*/
#else  
  #define uint unsigned int
#endif


//!!注意,地址为0xFF一定不能作为节点插入队列!!

//注意这种队列结构使得CAN_ZMAX+1个数组存储CAN_ZMAX个队列数据元
//因为头尾指针相等有两种可能,所以不允许存满!

#define List_ZMAX CAN_ZMAX+1

//定义状态列表的子结构
typedef struct
{
	uchar ucState;		//当前列表的序号。
	
	uchar ucListN;		//当前列表中节点数目。
	uchar ucListFirstP;	//当前列表中第一个进入的节点地址索引。
	uchar ucListLastP;	//当前列表中最后一个进入的节点地址索引。
	
	uchar List[List_ZMAX];	//当前列表的数组
	
}    StateListStruct;

extern xdata StateListStruct List_Work;		//1.工作列表
extern xdata StateListStruct List_Wait;		//2.等待列表
extern xdata StateListStruct List_Return;	//3.还原列表
extern xdata StateListStruct List_Nouse;	//4.备用列表
extern xdata StateListStruct List_Init;		//5.准备列表

/*
************************************************************************************************************************
**函数原型:  void List_Init(uchar NodeState);
**参数说明:  初始化清空当前列表。
**返回值:
**
**参数说明:     uchar NodeState		加入的节点状态

************************************************************************************************************************
*/
extern void ListInit(uchar NodeState);

/*
************************************************************************************************************************
**函数原型:  uchar List_AddNode(uchar NodeState,uchar NodeAddress);
**参数说明:  加入一个节点。(判断是否重复)
**返回值:		
**           	返回0xFF表示重复,或者队列满!
		返回NodeAddress表示成功。
**
**参数说明:     uchar NodeState		加入的节点状态
		uchar NodeAddress	加入的节点地址
************************************************************************************************************************
*/
extern uchar ListAddNode(uchar NodeState,uchar NodeAddress);


/*
************************************************************************************************************************
**函数原型:  uchar ListGetFirstNode(uchar NodeState);
**参数说明:  取出一个节点。(最先进入的节点)
**返回值:		
**           	返回0xFF表示失败。
		返回NodeAddress表示成功。
**
**参数说明:     uchar NodeState		加入的节点状态
************************************************************************************************************************
*/
extern uchar ListGetFirstNode(uchar NodeState);

/*
************************************************************************************************************************
**函数原型:  uchar ListGetTheNode(uchar NodeState,uchar NodeAddress);
**参数说明:  取出特定节点。(指定的节点)
**返回值:		
**           	返回0xFF表示失败。
		返回NodeAddress表示成功。
**
**参数说明:     uchar NodeState		加入的节点状态
		uchar NodeAddress	取出的节点地址
************************************************************************************************************************
*/
extern uchar ListGetTheNode(uchar NodeState,uchar NodeAddress);



#ifndef READYDEF_uint
  #undef uint
#endif

#ifndef READYDEF_uchar
  #undef uchar
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -