| 123456789101112131415161718192021222324252627282930 |
- #ifndef _FIFOQUEUE_H
- #define _FIFOQUEUE_H
- /* 包含的头文件-----------------------------------------------------------*/
- #include "stm32f10x.h"
- #include <stdbool.h>
- /* 宏定义 --------------------------------------------------------------------*/
- #define uint8 u8
- #define uint16 u16
- #define ElemType uint8
- #define QueueSize 20 //fifo队列的大小
- /* 类型定义 -----------------------------------------------------------------*/
- struct FifoQueue
- {
- uint16 front; //队列头
- uint16 rear; //队列尾
- uint16 count; //队列计数
- ElemType dat[QueueSize];
- };
- /* 常量定义 ----------------------------------------------------------------*/
- extern struct FifoQueue Fas_Tasks;
- extern struct FifoQueue Pub_Tasks;
- /* 函数定义---------------------------------------------------------------- */
- extern void QueueInit ( struct FifoQueue *Queue );
- extern bool QueueIn ( struct FifoQueue *Queue, ElemType sdat );
- extern bool QueueOut ( struct FifoQueue *Queue, ElemType *sdat );
- #endif
|