forked from haraldwolff/avr-fw-modules
24 lines
362 B
C
24 lines
362 B
C
|
#include <hwo/fifo.h>
|
||
|
#include <hwo/utils.h>
|
||
|
|
||
|
#include <string.h>
|
||
|
#include <stdlib.h>
|
||
|
|
||
|
/*! \brief Speicher für FIFO allozieren.
|
||
|
*
|
||
|
*/
|
||
|
FIFO* fifo_alloc(uint8_t size)
|
||
|
{
|
||
|
FIFO* fifo = malloc_ts(sizeof(FIFO));
|
||
|
if (fifo)
|
||
|
{
|
||
|
fifo->size = size;
|
||
|
fifo->pWrite = 0;
|
||
|
fifo->pRead = 0;
|
||
|
fifo->pBuffer = malloc_ts(size);
|
||
|
fifo->blocking = 1;
|
||
|
};
|
||
|
return fifo;
|
||
|
};
|
||
|
|