Skip to content

This repository contains a simple implementation of a priority queue for microcontrollers, like Texas MSP430 and so on.

Notifications You must be signed in to change notification settings

fjuliofontes/priority_queue_for_microcontrollers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Priority Queue for Microcontrollers

This repository contains a simple implementation of a priority queue for microcontrollers, like Texas MSP430, Arduino and so on.

This Priority Queue was implemented in a wireless network for traffic management (QoS) and the node_t structure contains the necessary parameters for my application. However, this structure can be easily modified for something else.

In Examples folder you can compile the software, and test it by yourself. For that you need to type:
mkdir build && cd build
cmake ..
make
./queue
node_t structure:
typedef struct node {
    uint8_t prio;
    uint8_t datalen;
    uint8_t data[RFM69H_MAX_MESG_SIZE];
    struct node *next;
} node_t;
Functions:
Add Messages:
uint8_t q_push(node_t **head, uint8_t *data, uint8_t datalen, uint8_t prio);
Remove Messages:
uint8_t q_pull(node_t **result, node_t **head);
Print current list by priority:
void print_list(node_t *head);
Check if queue is empty:
uint8_t isEmpty();
Check if queue is full:
uint8_t isFull();

About

This repository contains a simple implementation of a priority queue for microcontrollers, like Texas MSP430 and so on.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published