]> git.sur5r.net Git - freertos/blob - Demo/CORTEX_A2F200_IAR_and_Keil/MicroSemi_Code/CMSIS/mss_assert.h
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1372 1d2547de-c912-0410...
[freertos] / Demo / CORTEX_A2F200_IAR_and_Keil / MicroSemi_Code / CMSIS / mss_assert.h
1 /*******************************************************************************\r
2  * (c) Copyright 2009 Actel Corporation.  All rights reserved.\r
3  * \r
4  * Assertion implementation.\r
5  *\r
6  * This file provides the implementation of the ASSERT macro. This file can be\r
7  * modified to cater for project specific requirements regarding the way\r
8  * assertions are handled.\r
9  *\r
10  * SVN $Revision: 1676 $\r
11  * SVN $Date: 2009-12-02 16:47:03 +0000 (Wed, 02 Dec 2009) $\r
12  */\r
13 #ifndef __MSS_ASSERT_H_\r
14 #define __MSS_ASSERT_H_\r
15 \r
16 #include <assert.h>\r
17 \r
18 #if defined ( __GNUC__   )\r
19 \r
20 #if defined(NDEBUG)\r
21 \r
22 #define ASSERT(CHECK)\r
23 \r
24 #else   /* NDEBUG */\r
25 /*\r
26  * SoftConsole assertion handling\r
27  */\r
28 #define ASSERT(CHECK)  \\r
29     do { \\r
30         if (!(CHECK)) \\r
31         { \\r
32             __asm volatile ("BKPT\n\t"); \\r
33         } \\r
34     } while (0);\r
35     \r
36 #endif  /* NDEBUG */\r
37 \r
38 #else\r
39 /*\r
40  * IAR Embedded Workbench or Keil assertion handling.\r
41  * Call C library assert function which should result in error message\r
42  * displayed in debugger.\r
43  */\r
44 #define ASSERT(X)   assert(X)\r
45 \r
46 #endif\r
47 \r
48 #endif  /* __MSS_ASSERT_H_ */\r