]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_EFM32_Gecko_Starter_Kit_Simplicity_Studio/Source/SilLabs_Code/emlib/inc/em_assert.h
Add Pearl Gecko demo.
[freertos] / FreeRTOS / Demo / CORTEX_EFM32_Gecko_Starter_Kit_Simplicity_Studio / Source / SilLabs_Code / emlib / inc / em_assert.h
1 /***************************************************************************//**\r
2  * @file em_assert.h\r
3  * @brief Emlib peripheral API "assert" implementation.\r
4  * @version 4.2.1\r
5  *\r
6  * @details\r
7  * By default, emlib library assert usage is not included in order to reduce\r
8  * footprint and processing overhead. Further, emlib assert usage is decoupled\r
9  * from ISO C assert handling (NDEBUG usage), to allow a user to use ISO C\r
10  * assert without including emlib assert statements.\r
11  *\r
12  * Below are available defines for controlling emlib assert inclusion. The defines\r
13  * are typically defined for a project to be used by the preprocessor.\r
14  *\r
15  * @li If DEBUG_EFM is defined, the internal emlib library assert handling will\r
16  * be used, which may be a quite rudimentary implementation.\r
17  *\r
18  * @li If DEBUG_EFM_USER is defined instead, the user must provide their own\r
19  * assert handling routine (assertEFM()).\r
20  *\r
21  * As indicated above, if none of the above defines are used, emlib assert\r
22  * statements are not compiled.\r
23  *******************************************************************************\r
24  * @section License\r
25  * <b>(C) Copyright 2015 Silicon Labs, http://www.silabs.com</b>\r
26  *******************************************************************************\r
27  *\r
28  * Permission is granted to anyone to use this software for any purpose,\r
29  * including commercial applications, and to alter it and redistribute it\r
30  * freely, subject to the following restrictions:\r
31  *\r
32  * 1. The origin of this software must not be misrepresented; you must not\r
33  *    claim that you wrote the original software.\r
34  * 2. Altered source versions must be plainly marked as such, and must not be\r
35  *    misrepresented as being the original software.\r
36  * 3. This notice may not be removed or altered from any source distribution.\r
37  *\r
38  * DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Silicon Labs has no\r
39  * obligation to support this Software. Silicon Labs is providing the\r
40  * Software "AS IS", with no express or implied warranties of any kind,\r
41  * including, but not limited to, any implied warranties of merchantability\r
42  * or fitness for any particular purpose or warranties against infringement\r
43  * of any proprietary rights of a third party.\r
44  *\r
45  * Silicon Labs will not be liable for any consequential, incidental, or\r
46  * special damages, or any other relief, or for any claim by any third party,\r
47  * arising from your use of this Software.\r
48  *\r
49  ******************************************************************************/\r
50 \r
51 #ifndef __SILICON_LABS_EM_ASSERT_H__\r
52 #define __SILICON_LABS_EM_ASSERT_H__\r
53 \r
54 #ifdef __cplusplus\r
55 extern "C" {\r
56 #endif\r
57 \r
58 /** @cond DO_NOT_INCLUDE_WITH_DOXYGEN */\r
59 \r
60 #if defined(DEBUG_EFM) || defined(DEBUG_EFM_USER)\r
61 \r
62 /* Due to footprint considerations, we only pass file name and line number, */\r
63 /* not the assert expression (nor function name (C99)) */\r
64 void assertEFM(const char *file, int line);\r
65 #define EFM_ASSERT(expr)    ((expr) ? ((void)0) : assertEFM(__FILE__, __LINE__))\r
66 \r
67 #else\r
68 \r
69 #define EFM_ASSERT(expr)    ((void)(expr))\r
70 \r
71 #endif /* defined(DEBUG_EFM) || defined(DEBUG_EFM_USER) */\r
72 \r
73 /** @endcond */\r
74 \r
75 #ifdef __cplusplus\r
76 }\r
77 #endif\r
78 \r
79 #endif /* __SILICON_LABS_EM_ASSERT_H__ */\r