Minimize contract, add ADC read and send its data to coonsole
This commit is contained in:
19
esp32/main/ringbuf.h
Normal file
19
esp32/main/ringbuf.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define RINGBUF_SIZE 10
|
||||
|
||||
typedef struct {
|
||||
int values[RINGBUF_SIZE];
|
||||
int head;
|
||||
} ringbuf_t;
|
||||
|
||||
// Инициализация
|
||||
void ringbuf_init(ringbuf_t *rb);
|
||||
|
||||
// Добавить значение
|
||||
void ringbuf_push(ringbuf_t *rb, int v);
|
||||
|
||||
// Скопировать данные (в порядке времени)
|
||||
void ringbuf_copy(const ringbuf_t *rb, int *out);
|
||||
Reference in New Issue
Block a user