| 1 |
581 |
jeremybenn |
//*****************************************************************************
|
| 2 |
|
|
//
|
| 3 |
|
|
// debug.h - Macros for assisting debug of the driver library.
|
| 4 |
|
|
//
|
| 5 |
|
|
// Copyright (c) 2006 Luminary Micro, Inc. All rights reserved.
|
| 6 |
|
|
//
|
| 7 |
|
|
// Software License Agreement
|
| 8 |
|
|
//
|
| 9 |
|
|
// Luminary Micro, Inc. (LMI) is supplying this software for use solely and
|
| 10 |
|
|
// exclusively on LMI's Stellaris Family of microcontroller products.
|
| 11 |
|
|
//
|
| 12 |
|
|
// The software is owned by LMI and/or its suppliers, and is protected under
|
| 13 |
|
|
// applicable copyright laws. All rights are reserved. Any use in violation
|
| 14 |
|
|
// of the foregoing restrictions may subject the user to criminal sanctions
|
| 15 |
|
|
// under applicable laws, as well as to civil liability for the breach of the
|
| 16 |
|
|
// terms and conditions of this license.
|
| 17 |
|
|
//
|
| 18 |
|
|
// THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
|
| 19 |
|
|
// OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
|
| 20 |
|
|
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
|
| 21 |
|
|
// LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
|
| 22 |
|
|
// CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
|
| 23 |
|
|
//
|
| 24 |
|
|
// This is part of revision 991 of the Stellaris Driver Library.
|
| 25 |
|
|
//
|
| 26 |
|
|
//*****************************************************************************
|
| 27 |
|
|
|
| 28 |
|
|
#ifndef __DEBUG_H__
|
| 29 |
|
|
#define __DEBUG_H__
|
| 30 |
|
|
|
| 31 |
|
|
//*****************************************************************************
|
| 32 |
|
|
//
|
| 33 |
|
|
// Prototype for the function that is called when an invalid argument is passed
|
| 34 |
|
|
// to an API. This is only used when doing a DEBUG build.
|
| 35 |
|
|
//
|
| 36 |
|
|
//*****************************************************************************
|
| 37 |
|
|
extern void __error__(char *pcFilename, unsigned long ulLine);
|
| 38 |
|
|
|
| 39 |
|
|
//*****************************************************************************
|
| 40 |
|
|
//
|
| 41 |
|
|
// The ASSERT macro, which does the actual assertion checking. Typically, this
|
| 42 |
|
|
// will be for procedure arguments.
|
| 43 |
|
|
//
|
| 44 |
|
|
//*****************************************************************************
|
| 45 |
|
|
#ifdef DEBUG
|
| 46 |
|
|
#define ASSERT(expr) { \
|
| 47 |
|
|
if(!(expr)) \
|
| 48 |
|
|
{ \
|
| 49 |
|
|
__error__(__FILE__, __LINE__); \
|
| 50 |
|
|
} \
|
| 51 |
|
|
}
|
| 52 |
|
|
#else
|
| 53 |
|
|
#define ASSERT(expr)
|
| 54 |
|
|
#endif
|
| 55 |
|
|
|
| 56 |
|
|
#endif // __DEBUG_H__
|