SimpleFOClibrary 2.4.0
Loading...
Searching...
No Matches
SimpleFOCDebug Class Reference

#include <SimpleFOCDebug.h>

Static Public Member Functions

static void enable (Print *debugPrint=&Serial)
 
static void println (const __FlashStringHelper *msg)
 
static void println (const StringSumHelper msg)
 
static void println (const char *msg)
 
static void println (const __FlashStringHelper *msg, float val)
 
static void println (const char *msg, float val)
 
static void println (const __FlashStringHelper *msg, int val)
 
static void println (const char *msg, int val)
 
static void println (const char *msg, char val)
 
static void println ()
 
static void println (int val)
 
static void println (float val)
 
static void print (const char *msg)
 
static void print (const __FlashStringHelper *msg)
 
static void print (const StringSumHelper msg)
 
static void print (int val)
 
static void print (float val)
 

Static Protected Attributes

static Print * _debugPrint = NULL
 

Detailed Description

SimpleFOCDebug class

This class is used to print debug messages to a chosen output. Currently, Print instances are supported as targets, e.g. serial port.

Activate debug output globally by calling enable(), optionally passing in a Print instance. If none is provided "Serial" is used by default.

To produce debug output, use the macro SIMPLEFOC_DEBUG: SIMPLEFOC_DEBUG("Debug message!"); SIMPLEFOC_DEBUG("a float value:", 123.456f); SIMPLEFOC_DEBUG("an integer value: ", 123);

Keep debugging output short and simple. Some of our MCUs have limited RAM and limited serial output capabilities.

By default, the SIMPLEFOC_DEBUG macro uses the flash string helper to help preserve memory on Arduino boards.

You can also disable debug output completely. In this case all debug output and the SimpleFOCDebug class is removed from the compiled code. Add -DSIMPLEFOC_DISABLE_DEBUG to your compiler flags to disable debug in this way.

Definition at line 39 of file SimpleFOCDebug.h.

Member Function Documentation

◆ enable()

void SimpleFOCDebug::enable ( Print *  debugPrint = &Serial)
static

Definition at line 10 of file SimpleFOCDebug.cpp.

Here is the caller graph for this function:

◆ print() [1/5]

void SimpleFOCDebug::print ( const __FlashStringHelper *  msg)
static

Definition at line 84 of file SimpleFOCDebug.cpp.

◆ print() [2/5]

void SimpleFOCDebug::print ( const char *  msg)
static

Definition at line 77 of file SimpleFOCDebug.cpp.

◆ print() [3/5]

void SimpleFOCDebug::print ( const StringSumHelper  msg)
static

Definition at line 90 of file SimpleFOCDebug.cpp.

◆ print() [4/5]

void SimpleFOCDebug::print ( float  val)
static

Definition at line 112 of file SimpleFOCDebug.cpp.

◆ print() [5/5]

void SimpleFOCDebug::print ( int  val)
static

Definition at line 105 of file SimpleFOCDebug.cpp.

◆ println() [1/11]

void SimpleFOCDebug::println ( )
static

Definition at line 119 of file SimpleFOCDebug.cpp.

◆ println() [2/11]

void SimpleFOCDebug::println ( const __FlashStringHelper *  msg)
static

Definition at line 35 of file SimpleFOCDebug.cpp.

◆ println() [3/11]

void SimpleFOCDebug::println ( const __FlashStringHelper *  msg,
float  val 
)
static

Definition at line 49 of file SimpleFOCDebug.cpp.

◆ println() [4/11]

void SimpleFOCDebug::println ( const __FlashStringHelper *  msg,
int  val 
)
static

Definition at line 69 of file SimpleFOCDebug.cpp.

◆ println() [5/11]

void SimpleFOCDebug::println ( const char *  msg)
static

Definition at line 29 of file SimpleFOCDebug.cpp.

◆ println() [6/11]

void SimpleFOCDebug::println ( const char *  msg,
char  val 
)
static

Definition at line 62 of file SimpleFOCDebug.cpp.

◆ println() [7/11]

void SimpleFOCDebug::println ( const char *  msg,
float  val 
)
static

Definition at line 42 of file SimpleFOCDebug.cpp.

◆ println() [8/11]

void SimpleFOCDebug::println ( const char *  msg,
int  val 
)
static

Definition at line 56 of file SimpleFOCDebug.cpp.

◆ println() [9/11]

void SimpleFOCDebug::println ( const StringSumHelper  msg)
static

Definition at line 97 of file SimpleFOCDebug.cpp.

◆ println() [10/11]

void SimpleFOCDebug::println ( float  val)
static

Definition at line 21 of file SimpleFOCDebug.cpp.

◆ println() [11/11]

void SimpleFOCDebug::println ( int  val)
static

Definition at line 15 of file SimpleFOCDebug.cpp.

Member Data Documentation

◆ _debugPrint

Print * SimpleFOCDebug::_debugPrint = NULL
staticprotected

Definition at line 62 of file SimpleFOCDebug.h.


The documentation for this class was generated from the following files: