Skip to content

devcoons/stm32-lib-iqueue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IQUEUE LIBRARY

C/C++ CI Codacy Badge

Compiler flags: -O3 -Wfatal-errors -Wall -std=c11

Library for creating and manage queues.

Functions Guide

  • iqueue_init: initializes the structure.
  • iqueue_enqueue: puts an element at the end of the queue.
  • iqueue_dequque: takes out the first element of the queue.
  • iqueue_size: gets the size of the queue (number of elements).
  • iqueue_advance_next: advances a position in the queue.
  • iqueue_get_next_enqueue: returns the next element of the queue.
  • iqueue_dequeue_fast: returns the first element of the queue.

How to use

  • Include the header file lib_iqueue.h.
  • Create a iqueue_t instance.
  • Initialize the queue using iqueue_init

Example

typedef struct 
{
   uint8_t a[8];
   uint8_t b[8];
}data_t;

...
...

uint8_t storage[256];
iqueue_t queue;	

...
...

iqueue_init(&queue, 16,	sizeof(data_t), storage);

...
...

data_t d;
iqueue_enqueue(&queue,&d);

...
...

data_t r;
iqueue_dequeue(&queue,&r);

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published