1 /***************************************************************************//**
2 * @file
3 * @brief Assert API
4 *******************************************************************************
5 * # License
6 * <b>Copyright 2021 Silicon Laboratories Inc. www.silabs.com</b>
7 *******************************************************************************
8 *
9 * SPDX-License-Identifier: Zlib
10 *
11 * The licensor of this software is Silicon Laboratories Inc.
12 *
13 * This software is provided 'as-is', without any express or implied
14 * warranty. In no event will the authors be held liable for any damages
15 * arising from the use of this software.
16 *
17 * Permission is granted to anyone to use this software for any purpose,
18 * including commercial applications, and to alter it and redistribute it
19 * freely, subject to the following restrictions:
20 *
21 * 1. The origin of this software must not be misrepresented; you must not
22 * claim that you wrote the original software. If you use this software
23 * in a product, an acknowledgment in the product documentation would be
24 * appreciated but is not required.
25 * 2. Altered source versions must be plainly marked as such, and must not be
26 * misrepresented as being the original software.
27 * 3. This notice may not be removed or altered from any source distribution.
28 *
29 ******************************************************************************/
30
31 #include "sl_assert.h"
32 #include <stdbool.h>
33
34 /***************************************************************************//**
35 * @addtogroup assert
36 * @details
37 * This module contains functions to control the ASSERT peripheral of Silicon
38 * Labs 32-bit MCUs and SoCs.
39 * @{
40 ******************************************************************************/
41
42 #if defined(DEBUG_EFM)
43 /***************************************************************************//**
44 * @brief
45 * EFM internal assert handling.
46 *
47 * This function is invoked through EFM_ASSERT() macro usage only and should
48 * not be used explicitly.
49 *
50 * This implementation enters an indefinite loop, allowing
51 * the use of a debugger to determine a cause of failure. By defining
52 * DEBUG_EFM_USER to the preprocessor for all files, a user-defined version
53 * of this function must be defined and will be invoked instead, possibly
54 * providing output of assertion location.
55 *
56 * @note
57 * This function is not used unless DEBUG_EFM is defined
58 * during preprocessing of EFM_ASSERT() usage.
59 *
60 * @param[in] file
61 * Name of the source file where assertion failed.
62 *
63 * @param[in] line
64 * A line number in the source file where assertion failed.
65 ******************************************************************************/
assertEFM(const char * file,int line)66 void assertEFM(const char *file, int line)
67 {
68 (void)file; /* Unused parameter */
69 (void)line; /* Unused parameter */
70
71 while (true) {
72 }
73 }
74 #endif /* DEBUG_EFM */
75
76 /** @} (end addtogroup assert) */
77