Fix Debug

This commit is contained in:
Charles 2020-06-12 16:31:36 +02:00
parent e7dd3e1756
commit acc67b9e9f
1 changed files with 14 additions and 6 deletions

View File

@ -25,6 +25,8 @@
#ifndef LibTeleinfo_h
#define LibTeleinfo_h
#include "Arduino.h"
// Define this if you want library to be verbose
//#define TI_DEBUG
@ -44,10 +46,10 @@
#define TI_Debugflush Serial.flush
#endif
#else
#define TI_Debug(x)
#define TI_Debugln(x)
#define TI_Debugf(...)
#define TI_Debugflush
#define TI_Debug(x) {}
#define TI_Debugln(x) {}
#define TI_Debugf(...) {}
#define TI_Debugflush {}
#endif
// For 4 bytes Aligment boundaries
@ -61,14 +63,15 @@ typedef struct _ValueList ValueList;
struct _ValueList
{
ValueList *next; // next element
char * name; // LABEL of value name
char * value; // value
uint8_t checksum;// checksum
uint8_t flags; // specific flags
char * name; // LABEL of value name
char * value; // value
};
#pragma pack(pop)
// Library state machine
enum _State_e {
TINFO_INIT, // We're in init
@ -95,6 +98,11 @@ enum _State_e {
#define TINFO_SGR '\n' // start of group
#define TINFO_EGR '\r' // End of group
typedef void (*_fn_ADPS) (uint8_t);
typedef void (*_fn_data) (ValueList *, uint8_t);
typedef void (*_fn_new_frame) (ValueList *);
typedef void (*_fn_updated_frame) (ValueList *);
class TInfo
{
public: