abort events, polling instead

This commit is contained in:
Torsten Ruger
2021-07-02 23:20:42 +03:00
parent 3fad0f86f6
commit 1785f07706
6 changed files with 35 additions and 63 deletions

View File

@ -1,27 +1,24 @@
#include <Arduino.h>
#include <queue>
void serial_setup();
void serial_loop();
class WsSerial{
std::queue<String> debug;
public:
void print(const String& );
void println(const String& );
inline void print(const String& line){ debug.push(line); }
inline void println(const String& line){ debug.push(line); }
inline void println(const float num){ println(String(num)) ; };
inline const String& pop(){ const String& first = debug.front(); debug.pop(); return first;};
inline bool empty(){ return debug.empty();};
};
static WsSerial debug_out;
#if(false)
#define DEBUG_OUT Serial
#define DEBUG_SERIAL true
#else
#define DEBUG_SERIAL false
static WsSerial debug_out;
#define DEBUG_OUT debug_out
#endif