debug.h
Go to the documentation of this file.
00001 //*****************************************************************************
00002 //
00003 //debug.h - Macros for assisting debug of the driver library.
00004 //
00005 //
00006 //This is part of revision 0001 of the MSP430 Peripheral Driver Library.
00007 //
00008 //*****************************************************************************
00009 
00010 #ifndef __DEBUG_H__
00011 #define __DEBUG_H__
00012 
00013 //*****************************************************************************
00014 //
00015 //Prototype for the function that is called when an invalid argument is passed
00016 //to an API.  This is only used when doing a DEBUG build.
00017 //
00018 //*****************************************************************************
00019 extern void __error__ (char *pcFilename, unsigned long ulLine);
00020 
00021 //*****************************************************************************
00022 //
00023 //The ASSERT macro, which does the actual assertion checking.  Typically, this
00024 //will be for procedure arguments.
00025 //
00026 //*****************************************************************************
00027 #ifdef DEBUG
00028 #define ASSERT(expr) {                                      \
00029         if (!(expr))                        \
00030         {                                  \
00031             __error__(__FILE__, __LINE__); \
00032         }                                  \
00033 }
00034 #else
00035 #define ASSERT(expr)
00036 #endif
00037 
00038 #endif //__DEBUG_H__
00039 

Copyright 2012, Texas Instruments Incorporated