51 lines
797 B
C
51 lines
797 B
C
#ifndef _USER_QUEUE_H
|
|
#define _USER_QUEUE_H
|
|
#include "Include.h"
|
|
#include "stdbool.h"
|
|
|
|
#define QUEUE_ZISE 5000//队列长度
|
|
|
|
typedef struct Queue
|
|
{
|
|
int qFront;//队首
|
|
int qRear;//队尾
|
|
uint8_t BasicArr[QUEUE_ZISE];//队列数据
|
|
}Queue, * pQueue;
|
|
//Queue 等效于 struct Queue
|
|
//pQueue 等效于 struct Queue *
|
|
|
|
typedef struct data_load
|
|
{
|
|
uint8_t sendbuf[10];//数据下发
|
|
uint8_t recvbuf[100];//数据接收缓冲区
|
|
uint16_t rxlen;//上传数据长度
|
|
}DATA_LOAD_T;
|
|
|
|
extern Queue queue;
|
|
|
|
extern DATA_LOAD_T data_load;
|
|
|
|
void InitQueue(pQueue queue);
|
|
uint8_t EnterQueue(pQueue queue, uint8_t *value,uint16_t len);
|
|
uint8_t OutQueue(pQueue queue,uint8_t *out,uint16_t len);
|
|
|
|
uint8_t Analysis_Queue_data(pQueue queue);
|
|
|
|
bool IsEmptyQueue(pQueue queue);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|