Code Monkey home page Code Monkey logo

cqueue's Introduction

cqueue

介绍

一个环形队列缓冲区,支持单个、多个和全部操作方式。

函数列表

uint8_t queue_put(queue_t *queue,uint8_t ch);
uint8_t queue_put_length(queue_t *queue,uint8_t *buffer,uint16_t length);
uint8_t queue_get(queue_t *queue,uint8_t *ch);
uint8_t queue_peek(queue_t *queue,uint8_t *ch);
uint8_t queue_peek_length(queue_t *queue,uint8_t *buffer,uint16_t length);
uint8_t queue_peek_all(queue_t *queue,uint8_t *buffer);
void queue_pop(queue_t *queue);
void queue_pop_length(queue_t *queue,uint16_t length);
void queue_pop_all(queue_t *queue);

使用方法

1、初始化


#define QUEUE_BUF_SIZE     512                      //定义缓冲区长度
uint8_t queue_event_buf[QUEUE_EVENT_BUF_SIZE];      //定义缓冲区
queue_t queue_event;                                //定义队列句柄


queue_init_static(&queue_event,queue_event_buf,QUEUE_BUF_SIZE);  //初始化

2、使用

main.c 简单介绍了实际中的一些使用方法

cqueue's People

Contributors

redoccheng avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.