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