|
void | connect_serial_debug (long baud) |
| Connects to a computer over USB Serial for debugging. More...
|
|
void | print_hexdump (Short_Name channel, const char *msg, uint8_t *src, uint8_t size) |
| Helper function to print the hexdump of a region of memory. More...
|
|
template<typename Arg > |
void | print_args (std::ostream &oss, const Arg &arg) |
| Base case of the recursive debug print. More...
|
|
template<typename Arg , typename... Args> |
void | print_args (std::ostream &oss, const Arg &arg, const Args &...args) |
| Recursive case of the recursive debug print. More...
|
|
template<typename... Args> |
void | print_debug (Short_Name channel, const Args &...args) |
| Helper function to print debug messages. More...
|
|
template<typename... Args> |
void | print_debug_rapid (Short_Name channel, const Args &...args) |
| Helper function to print debug messages quickly. More...
|
|
Helper functions and debugging tools.
template<typename Arg , typename... Args>
void Helpers::print_args |
( |
std::ostream & |
oss, |
|
|
const Arg & |
arg, |
|
|
const Args &... |
args |
|
) |
| |
Recursive case of the recursive debug print.
This function, in combination with its base case version, recursively goes through each argument passed into it, appends the first argument to the output stream, then passes the remaining arguments to the next iteration of the function. This repeats until the base case is reached and the complete output stream is built.
Practically, this function can be called with an arbitrary number of arguments. The arguments are appended to each other as if they were each passed into std::ostream.
For example, print_args("Hello World! int=", int)
and print_args("This ", "is ", "a ", "test ")
are both valid uses of this function.
- Template Parameters
-
Arg | The generic type of the argument to be appended to the stream. |
Args | The generic type of the remaining arguments. |
- Parameters
-
oss | The output stream containing the string to be printed. |
arg | The argument to be added to the ouput string. |
args | The remaining arguments. |