IRQ based tag polling

This commit is contained in:
2022-03-10 22:25:35 +01:00
parent b01caeda28
commit 97aa264b54
5 changed files with 448 additions and 112 deletions

View File

@ -2,7 +2,8 @@
#define SERIAL_H
#define BAUD 38400
#define SERIAL_BUFFER_SIZE 384
#define SERIAL_RX_BUFFER_SIZE 256
#define SERIAL_TX_BUFFER_SIZE 128
#include <util/setbaud.h>
#include <avr/io.h>
@ -11,15 +12,25 @@
#include <stdlib.h>
#include <avr/pgmspace.h>
#include "ringbuffer.h"
const bool serialFlowControl = false;
class Serial
{
private:
char _terminator = '\n';
Serial();
public:
Serial();
volatile RingBuffer<SERIAL_RX_BUFFER_SIZE, volatile uint8_t> rxBuffer;
volatile RingBuffer<SERIAL_TX_BUFFER_SIZE, volatile uint8_t> txBuffer;
bool stopped = false;
volatile bool transmitting = false;
static Serial* getInstance();
void putChar(const char c);
void write(const char* in, const unsigned int length);
void write(const char in[]);