#ifndef DEBUG_H #define DEBUG_H #include "config.h" template class DebugImpl { public: template static inline void print(T t, int format = DEC); template static inline void print(const T *t); template static inline void println(T t, int format = DEC); template static inline void println(const T *t); static inline void println(); }; template template inline void DebugImpl::print(T t, int format) { if (enable) { Serial.print(t, format); } } template template inline void DebugImpl::print(const T *t) { if (enable) { Serial.print(t); } } template template inline void DebugImpl::println(T t, int format) { if (enable) { Serial.println(t, format); } } template template inline void DebugImpl::println(const T *t) { if (enable) { Serial.println(t); } } template inline void DebugImpl::println() { if (enable) { Serial.println(); } } #if ENABLE_DEBUG_LOG == 1 typedef DebugImpl Debug; #else typedef DebugImpl Debug; #endif #endif