add .gitignore, first changes of ringbuffer

This commit is contained in:
2020-06-17 09:32:36 +02:00
parent 9552a54c3d
commit d5e7b8b149
3 changed files with 49 additions and 33 deletions

View File

@ -2,8 +2,21 @@
#define _RINGBUFFER_H_
#include <stdint.h>
#include <pthread.h>
void ringbufferPut(uint32_t f);
uint32_t ringbufferGet();
#define BUFFER_SIZE 256
typedef struct {
void* buffer[BUFFER_SIZE+5];
uint32_t bufferReadIdx;
uint32_t bufferWriteIdx;
pthread_mutex_t eventMutex;
pthread_cond_t eventSignal;
} t_ringbuffer;
void ringbufferInit(t_ringbuffer *handle);
void ringbufferPut(t_ringbuffer *handle, void *f);
void *ringbufferGet(t_ringbuffer *handle);
#endif // _RINGBUFFER_H_