Fawwaz Nadzmy / mbed-STM

Fork of mbed-dev by mbed official

Committer:
bogdanm
Date:
Thu Oct 01 15:25:22 2015 +0300
Revision:
0:9b334a45a8ff
Child:
50:a417edff4437
Initial commit on mbed-dev

Replaces mbed-src (now inactive)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bogdanm 0:9b334a45a8ff 1 /***************************************************************************//**
bogdanm 0:9b334a45a8ff 2 * @file em_assert.c
bogdanm 0:9b334a45a8ff 3 * @brief Assert API
bogdanm 0:9b334a45a8ff 4 * @version 3.20.12
bogdanm 0:9b334a45a8ff 5 *******************************************************************************
bogdanm 0:9b334a45a8ff 6 * @section License
bogdanm 0:9b334a45a8ff 7 * <b>(C) Copyright 2014 Silicon Labs, http://www.silabs.com</b>
bogdanm 0:9b334a45a8ff 8 *******************************************************************************
bogdanm 0:9b334a45a8ff 9 *
bogdanm 0:9b334a45a8ff 10 * Permission is granted to anyone to use this software for any purpose,
bogdanm 0:9b334a45a8ff 11 * including commercial applications, and to alter it and redistribute it
bogdanm 0:9b334a45a8ff 12 * freely, subject to the following restrictions:
bogdanm 0:9b334a45a8ff 13 *
bogdanm 0:9b334a45a8ff 14 * 1. The origin of this software must not be misrepresented; you must not
bogdanm 0:9b334a45a8ff 15 * claim that you wrote the original software.
bogdanm 0:9b334a45a8ff 16 * 2. Altered source versions must be plainly marked as such, and must not be
bogdanm 0:9b334a45a8ff 17 * misrepresented as being the original software.
bogdanm 0:9b334a45a8ff 18 * 3. This notice may not be removed or altered from any source distribution.
bogdanm 0:9b334a45a8ff 19 *
bogdanm 0:9b334a45a8ff 20 * DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Silicon Labs has no
bogdanm 0:9b334a45a8ff 21 * obligation to support this Software. Silicon Labs is providing the
bogdanm 0:9b334a45a8ff 22 * Software "AS IS", with no express or implied warranties of any kind,
bogdanm 0:9b334a45a8ff 23 * including, but not limited to, any implied warranties of merchantability
bogdanm 0:9b334a45a8ff 24 * or fitness for any particular purpose or warranties against infringement
bogdanm 0:9b334a45a8ff 25 * of any proprietary rights of a third party.
bogdanm 0:9b334a45a8ff 26 *
bogdanm 0:9b334a45a8ff 27 * Silicon Labs will not be liable for any consequential, incidental, or
bogdanm 0:9b334a45a8ff 28 * special damages, or any other relief, or for any claim by any third party,
bogdanm 0:9b334a45a8ff 29 * arising from your use of this Software.
bogdanm 0:9b334a45a8ff 30 *
bogdanm 0:9b334a45a8ff 31 ******************************************************************************/
bogdanm 0:9b334a45a8ff 32
bogdanm 0:9b334a45a8ff 33
bogdanm 0:9b334a45a8ff 34 #include "em_assert.h"
bogdanm 0:9b334a45a8ff 35
bogdanm 0:9b334a45a8ff 36 #if defined(DEBUG_EFM)
bogdanm 0:9b334a45a8ff 37
bogdanm 0:9b334a45a8ff 38 /***************************************************************************//**
bogdanm 0:9b334a45a8ff 39 * @brief
bogdanm 0:9b334a45a8ff 40 * EFM internal assert handling.
bogdanm 0:9b334a45a8ff 41 *
bogdanm 0:9b334a45a8ff 42 * This function is invoked through EFM_ASSERT() macro usage only, it should
bogdanm 0:9b334a45a8ff 43 * not be used explicitly.
bogdanm 0:9b334a45a8ff 44 *
bogdanm 0:9b334a45a8ff 45 * Currently this implementation only enters an indefinite loop, allowing
bogdanm 0:9b334a45a8ff 46 * the use of a debugger to determine cause of failure. By defining
bogdanm 0:9b334a45a8ff 47 * DEBUG_EFM_USER to the preprocessor for all files, a user defined version
bogdanm 0:9b334a45a8ff 48 * of this function must be defined and will be invoked instead, possibly
bogdanm 0:9b334a45a8ff 49 * providing output of assertion location.
bogdanm 0:9b334a45a8ff 50 *
bogdanm 0:9b334a45a8ff 51 * Please notice that this function is not used unless DEBUG_EFM is defined
bogdanm 0:9b334a45a8ff 52 * during preprocessing of EFM_ASSERT() usage.
bogdanm 0:9b334a45a8ff 53 *
bogdanm 0:9b334a45a8ff 54 * @par file
bogdanm 0:9b334a45a8ff 55 * Name of source file where assertion failed.
bogdanm 0:9b334a45a8ff 56 *
bogdanm 0:9b334a45a8ff 57 * @par line
bogdanm 0:9b334a45a8ff 58 * Line number in source file where assertion failed.
bogdanm 0:9b334a45a8ff 59 ******************************************************************************/
bogdanm 0:9b334a45a8ff 60 void assertEFM(const char *file, int line)
bogdanm 0:9b334a45a8ff 61 {
bogdanm 0:9b334a45a8ff 62 (void)file; /* Unused parameter */
bogdanm 0:9b334a45a8ff 63 (void)line; /* Unused parameter */
bogdanm 0:9b334a45a8ff 64
bogdanm 0:9b334a45a8ff 65 while (1)
bogdanm 0:9b334a45a8ff 66 ;
bogdanm 0:9b334a45a8ff 67 }
bogdanm 0:9b334a45a8ff 68
bogdanm 0:9b334a45a8ff 69 #endif /* DEBUG_EFM */