zbcache.nc
来自「IEEE802.15.4标准下的基于ZIGBEE协议栈的物理及链路层的代码」· NC 代码 · 共 62 行
NC
62 行
/****** * FIFO cache interface */interface ZbCache<t> {/***** * get a empty element from free queue, return NULL if free queue is empty. * after call fetchFree(), the first element in free queue will be delete. * producer should fill the element and put it into full queue for consumer use. */ async command t* fetchFree();/**** * put the element into free queue, return SUCCESS if put success, FAIL otherwise. * after using the element, consumer should put it back into free queue for producer use. */ async command error_t putFree(t* pElement);/** * get the first full element from full queue, return NULL if full queue is empty. * after call getFree(), the first element in full queue will not be delete. */ async command t* getFull();/** * get the first full element from full queue, return NULL if full queue is empty. * after call fetchFree(), the first element in full queue will be delete. */ async command t* fetchFull();/** * put the element into end of full queue, return SUCCESS if put success, FAIL otherwise. * producer should put the element into full queue after fill element. */ async command error_t putFull(t* pElement); /** * return the number of free element in queue. * */ async command uint8_t getFreeNum();/** * return the number of full element in queue. * */ async command uint8_t getFullNum();}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?