rik te winkel / mbed-dev

Dependents:   Numitron_clock

Fork of mbed-dev by mbed official

Committer:
<>
Date:
Fri Sep 02 15:07:44 2016 +0100
Revision:
144:ef7eb2e8f9f7
Parent:
50:a417edff4437
This updates the lib to the mbed lib v125

Who changed what in which revision?

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