N4 Flight Software N4
Flight software used for the N4 flight computers
Loading...
Searching...
No Matches
ring_buffer.h
Go to the documentation of this file.
1
5
6#ifndef N4_FLIGHT_SOFTWARE_RING_BUFFER_H
7#define N4_FLIGHT_SOFTWARE_RING_BUFFER_H
8
9#include <Arduino.h>
10#include <cstring>
11
12#define SIZE_OF_BUFFER 5
13
14typedef struct {
15 float buffer[SIZE_OF_BUFFER];
16 uint8_t write_index;
17 uint8_t read_index;
18 uint8_t buffer_length;
19
21
22void ring_buffer_init(ring_buffer*);
23void ring_buffer_put(ring_buffer*, float);
24float ring_buffer_get(ring_buffer* r);
25uint8_t ring_buffer_available(ring_buffer* r);
26uint8_t ring_buffer_full(ring_buffer* r);
27uint8_t ring_buffer_empty(ring_buffer* r);
28void ring_buffer_flush(ring_buffer* r);
29
30#endif
Definition ring_buffer.h:14