Simple sample of using a debug class and macros.

Dependencies:   mbed

debug.h

Committer:
jimcooper
Date:
2015-08-30
Revision:
0:885c11431d59

File content as of revision 0:885c11431d59:

#ifndef __DEBUG_H__
#define __DEBUG_H__


#ifndef DEBUG
  #define DEBUG // Comment this out for release mode builds.
#endif


// Simple error reporting.
#ifdef DEBUG
    #define DEBUG_ERROR(x) g_debugger.error(x);
#else
    #define DEBUG_ERROR(x) // x;
#endif



// debug error reporting object
class debug
{
    public:

        void error(const char* text);
};


// Created in the debug.cpp file.
extern debug g_debugger;



#endif // __DEBUG_H__