Domotique/WifiControlSensor/debug_sketch.h
Mathieu Maret a990ce0055 Make Serial output optionnal
Save 2k of ROM
2016-03-26 15:07:15 +01:00

19 lines
583 B
C

#pragma once
//#define SKETCH_DEBUG
// Set where debug messages will be printed.
#define DEBUG_PRINTER Serial
#ifdef SKETCH_DEBUG
#define SKETCH_DEBUG_INIT(speed){ DEBUG_PRINTER.begin(speed); }
#define SKETCH_DEBUG_PRINT(...) { DEBUG_PRINTER.print(__VA_ARGS__); }
#define SKETCH_DEBUG_PRINTF(...) { DEBUG_PRINTER.printf(__VA_ARGS__); }
#define SKETCH_DEBUG_PRINTLN(...) { DEBUG_PRINTER.println(__VA_ARGS__); }
#else
#define SKETCH_DEBUG_INIT(speed)
#define SKETCH_DEBUG_PRINT(...) {}
#define SKETCH_DEBUG_PRINTF(...) {}
#define SKETCH_DEBUG_PRINTLN(...) {}
#endif