]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_EFM32_Gecko_Starter_Kit_Simplicity_Studio/Source/SilLabs_Code/emlib/inc/em_assert.h
Add EFM32 Giant Gecko Starter Kit demo - still a work in progress as the low power...
[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 EFM32 peripheral API "assert" implementation.\r
4  * @version 4.0.0\r
5  *\r
6  * @details\r
7  * By default, EFM32 library assert usage is not included in order to reduce\r
8  * footprint and processing overhead. Further, EFM32 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 EFM32 assert statements.\r
11  *\r
12  * Below are available defines for controlling EFM32 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 EFM32 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 its own EFM32\r
19  * assert handling routine (assertEFM()).\r
20  *\r
21  * As indicated above, if none of the above defines are used, EFM32 assert\r
22  * statements are not compiled.\r
23  *******************************************************************************\r
24  * @section License\r
25  * <b>(C) Copyright 2014 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 \r
52 #ifndef __SILICON_LABS_EM_ASSERT_H_\r
53 #define __SILICON_LABS_EM_ASSERT_H_\r
54 \r
55 #ifdef __cplusplus\r
56 extern "C" {\r
57 #endif\r
58 \r
59 /** @cond DO_NOT_INCLUDE_WITH_DOXYGEN */\r
60 \r
61 #if defined(DEBUG_EFM) || defined(DEBUG_EFM_USER)\r
62 \r
63 /* Due to footprint considerations, we only pass file name and line number, */\r
64 /* not the assert expression (nor function name (C99)) */\r
65 void assertEFM(const char *file, int line);\r
66 #define EFM_ASSERT(expr)    ((expr) ? ((void)0) : assertEFM(__FILE__, __LINE__))\r
67 \r
68 #else\r
69 \r
70 #define EFM_ASSERT(expr)    ((void)(expr))\r
71 \r
72 #endif /* defined(DEBUG_EFM) || defined(DEBUG_EFM_USER) */\r
73 \r
74 /** @endcond */\r
75 \r
76 #ifdef __cplusplus\r
77 }\r
78 #endif\r
79 \r
80 #endif /* __SILICON_LABS_EM_ASSERT_H_ */\r