EmbeddedEtcher
Functions
queues.c File Reference
#include "stdlib.h"
#include "stm32f10x.h"
#include "queues.h"
#include <string.h>
Include dependency graph for queues.c:

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)
 

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.