Изменил(а) на 'UART/circular_buf.h'

This commit is contained in:
Никита Солодянкин 2023-06-18 10:59:28 +00:00
parent 4956ae0a24
commit e22c380faa

View File

@ -1,18 +1,18 @@
#ifndef CIRCULAR_BUFFER_H #ifndef CIRCULAR_BUFFER_H
#define CIRCULAR_BUFFER_H #define CIRCULAR_BUFFER_H
#define BUFFER_SIZE 10 #define BUFFER_SIZE 32
typedef struct { struct circular_buffer{
int buffer[BUFFER_SIZE]; unsigned char buffer[BUFFER_SIZE];
int BufHead; unsigned char buf_head;
int BufTail; unsigned char buf_tail;
} CircularBuffer; };
void initializeBuffer(CircularBuffer* cb); void initialize_buffer(struct circular_buffer* cb);
int BufferEmpty(const CircularBuffer* cb); int buffer_empty(const struct circular_buffer* cb);
int BufferFull(const CircularBuffer* cb); int buffer_full(const struct circular_buffer* cb);
void writeBuffer(CircularBuffer* cb, int value); void write_buffer(struct circular_buffer* cb, int value);
int readBuffer(CircularBuffer* cb); int read_buffer(struct circular_buffer* cb);
#endif /* CIRCULAR_BUFFER_H */ #endif /* CIRCULAR_BUFFER_H */