forked from H4jen/webasto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebasto.h
33 lines (24 loc) · 1011 Bytes
/
webasto.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef WEBASTO_H
#define WEBASTO_H
#define BAUD_RATE 2400
#define DEBUG //If you comment this line, the DPRINT & DPRINTLN lines are defined as blank.
#ifdef DEBUG //Macros are usually in all capital letters.
#define DPRINT(...) Serial.print(__VA_ARGS__) //DPRINT is a macro, debug print
#define DPRINTHEX(...) debugprinthex(__VA_ARGS__,0)
#define DPRINTLN(...) Serial.println(__VA_ARGS__) //DPRINTLN is a macro, debug print with new line
#define DPRINTLNHEX(...) debugprinthex(__VA_ARGS__,1)
#define DPRINTC(...) Serial.print(itoa(__VA_ARGS__))
#else
#define DPRINTC(...)
#define DPRINT(...) //now defines a blank line
#define DPRINTLN(...) //now defines a blank line
#define DPRINTHEX(...)
#define DPRINTLNHEX(...)
#endif
#define MESSAGE_BUFFER_SIZE 256
#include <Arduino.h>
//Here we define global variables we need to reference
//This global struct holds the message read from the webasto.
//extern CustomSoftwareSerial* mySerial;
void debugprinthex(int c,int newline);
#endif