EmbeddedEtcher
queues.h File Reference

Implementation for queues. More...

#include <stm32f10x.h>
#include "ostypes.h"
#include <stdlib.h>
Include dependency graph for queues.h:

Go to the source code of this file.

Functions

void osQInit (osQUEUE_t *q, size_t ivarsize, uint16_t iqsize, void *istart)
 
uint8_t osEnqueue (osQUEUE_t *q, void *data)
 
uint8_t osDequeue (osQUEUE_t *q, void *data)
 

Detailed Description

Implementation for queues.

Author
Maximilian Stiefel
Date
8 Jan 2018

Function Documentation

◆ osDequeue()

uint8_t osDequeue ( osQUEUE_t q,
void *  data 
)

Copy data from the q.

Parameters
qQ we are talking about.
dataPointer to a local variable where the data from the q shall end up.
Return values
1(data successfully copied) or 0 (q is empty).

◆ osEnqueue()

uint8_t osEnqueue ( osQUEUE_t q,
void *  data 
)

Copy data to the q.

Parameters
qQ we are talking about.
dataPointer to a local variable where data is stored.
Return values
1(data successfully copied) or 0 (q is full).

◆ osQInit()

void osQInit ( osQUEUE_t q,
size_t  ivarsize,
uint16_t  iqsize,
void *  istart 
)

Function to initialize a queue properly.

Parameters
qPointer to the memory where the q is stored.
ivarsizeSize of the variable type stored in the q in bytes.
iqsizeNumber of slots of the q.
istartPointer to the array where the actual data of the q is stored.