LSH-Core
A robust C++ framework for Arduino-based home automation nodes
Loading...
Searching...
No Matches
vaprint.hpp
Go to the documentation of this file.
1
21#ifndef LSHCORE_UTIL_DEBUG_VAPRINT_HPP
22#define LSHCORE_UTIL_DEBUG_VAPRINT_HPP
23
24#include <stdint.h>
25
27
28namespace VaPrint
29{
30
31 extern uint8_t base;
32 extern uint8_t prec;
33
34 void setBase(uint8_t b);
35 void setPrec(uint8_t p);
36
37 void print(const String &str);
38 void print(char c);
39 void print(char *str);
40 void print(const char *str);
41 void print(const __FlashStringHelper *str);
42 void print(float f);
43 void print(double d);
44 void println();
45
46 template <typename T>
47 static inline void print(T value)
48 {
49 CONFIG_DEBUG_SERIAL->print(value, base);
50 }
51
52 template <typename T, typename... Rest>
53 static inline void print(T value, Rest... rest)
54 {
55 print(value);
56 print(rest...);
57 }
58
59 template <typename T, typename... Rest>
60 __attribute__((always_inline)) static inline void println(T value, Rest... rest)
61 {
62 print(value);
63 println(rest...);
64 }
65
66} // namespace VaPrint
67
68#endif // LSHCORE_UTIL_DEBUG_VAPRINT_HPP
Internal bridge that imports user-defined macros into the library's scope.