forked from haraldwolff/avr-fw-modules
19 lines
277 B
C
19 lines
277 B
C
|
#include <hwo/fifo.h>
|
||
|
#include <sys/atomic.h>
|
||
|
#include <hwo/threads.h>
|
||
|
|
||
|
uint16_t fifo_read_block (FIFO* fifo,uint8_t* buffer,int maxlen)
|
||
|
{
|
||
|
int n;
|
||
|
|
||
|
for (n=0;n<maxlen;n++)
|
||
|
{
|
||
|
int ch = fifo_poll(fifo);
|
||
|
if (ch == -1)
|
||
|
return n;
|
||
|
buffer[n] = ch & 0xff;
|
||
|
};
|
||
|
return n;
|
||
|
};
|
||
|
|