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
14
typedef
struct
{
15
float
buffer[SIZE_OF_BUFFER];
16
uint8_t write_index;
17
uint8_t read_index;
18
uint8_t buffer_length;
19
20
}
ring_buffer
;
21
22
void
ring_buffer_init(
ring_buffer
*);
23
void
ring_buffer_put(
ring_buffer
*,
float
);
24
float
ring_buffer_get(
ring_buffer
* r);
25
uint8_t ring_buffer_available(
ring_buffer
* r);
26
uint8_t ring_buffer_full(
ring_buffer
* r);
27
uint8_t ring_buffer_empty(
ring_buffer
* r);
28
void
ring_buffer_flush(
ring_buffer
* r);
29
30
#endif
ring_buffer
Definition
ring_buffer.h:14
n4-flight-software
src
ring_buffer.h
Generated by
1.13.1