improved serial handeling added aux state info

This commit is contained in:
IMback
2018-09-03 20:47:01 +02:00
parent 296d38e8b0
commit 20b4663887
9 changed files with 676 additions and 659 deletions

View File

@ -2,7 +2,7 @@
#define SERIAL_H
#define BAUD 38400
#define BUFFER_SIZE 128
#define SERIAL_BUFFER_SIZE 128
#include <util/setbaud.h>
#include <avr/io.h>
@ -11,12 +11,12 @@
#include <stdlib.h>
#include <avr/pgmspace.h>
const bool serialFlowControl = false;
class Serial
{
private:
char _terminator = '\n';
uint16_t _rxIndex=0;
public:
Serial();
@ -25,6 +25,7 @@ public:
void write(const char in[]);
void write_p(const char in[]); //for flash space strigns
void write(const int32_t in);
unsigned int read( char* buffer, const unsigned int length );
bool dataIsWaiting();
char getChar();
unsigned int getString(char* buffer, const int bufferLength);