IRQ based tag polling
This commit is contained in:
15
serial.h
15
serial.h
@ -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[]);
|
||||
|
Reference in New Issue
Block a user