1 |
610 |
jeremybenn |
//*****************************************************************************
|
2 |
|
|
//
|
3 |
|
|
// debug.h - Macros for assisting debug of the driver library.
|
4 |
|
|
//
|
5 |
|
|
// Copyright (c) 2006-2008 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 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. You may not combine
|
14 |
|
|
// this software with "viral" open-source software in order to form a larger
|
15 |
|
|
// program. Any use in violation of the foregoing restrictions may subject
|
16 |
|
|
// the user to criminal sanctions under applicable laws, as well as to civil
|
17 |
|
|
// liability for the breach of the terms and conditions of this license.
|
18 |
|
|
//
|
19 |
|
|
// THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
|
20 |
|
|
// OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
|
21 |
|
|
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
|
22 |
|
|
// LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
|
23 |
|
|
// CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
|
24 |
|
|
//
|
25 |
|
|
// This is part of revision 2523 of the Stellaris Peripheral Driver Library.
|
26 |
|
|
//
|
27 |
|
|
//*****************************************************************************
|
28 |
|
|
|
29 |
|
|
#ifndef __DEBUG_H__
|
30 |
|
|
#define __DEBUG_H__
|
31 |
|
|
|
32 |
|
|
//*****************************************************************************
|
33 |
|
|
//
|
34 |
|
|
// Prototype for the function that is called when an invalid argument is passed
|
35 |
|
|
// to an API. This is only used when doing a DEBUG build.
|
36 |
|
|
//
|
37 |
|
|
//*****************************************************************************
|
38 |
|
|
extern void __error__(char *pcFilename, unsigned long ulLine);
|
39 |
|
|
|
40 |
|
|
//*****************************************************************************
|
41 |
|
|
//
|
42 |
|
|
// The ASSERT macro, which does the actual assertion checking. Typically, this
|
43 |
|
|
// will be for procedure arguments.
|
44 |
|
|
//
|
45 |
|
|
//*****************************************************************************
|
46 |
|
|
#ifdef DEBUG
|
47 |
|
|
#define ASSERT(expr) { \
|
48 |
|
|
if(!(expr)) \
|
49 |
|
|
{ \
|
50 |
|
|
__error__(__FILE__, __LINE__); \
|
51 |
|
|
} \
|
52 |
|
|
}
|
53 |
|
|
#else
|
54 |
|
|
#define ASSERT(expr)
|
55 |
|
|
#endif
|
56 |
|
|
|
57 |
|
|
#endif // __DEBUG_H__
|