1
1
/*
2
- * Copyright (c) 2006 Nordic Semiconductor. All Rights Reserved.
2
+ * Copyright (c) Nordic Semiconductor ASA
3
+ * All rights reserved.
3
4
*
4
- * The information contained herein is confidential property of Nordic Semiconductor. The use,
5
- * copying, transfer or disclosure of such information is prohibited except by express written
6
- * agreement with Nordic Semiconductor.
5
+ * Redistribution and use in source and binary forms, with or without modification,
6
+ * are permitted provided that the following conditions are met:
7
+ *
8
+ * 1. Redistributions of source code must retain the above copyright notice, this
9
+ * list of conditions and the following disclaimer.
10
+ *
11
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this
12
+ * list of conditions and the following disclaimer in the documentation and/or
13
+ * other materials provided with the distribution.
14
+ *
15
+ * 3. Neither the name of Nordic Semiconductor ASA nor the names of other
16
+ * contributors to this software may be used to endorse or promote products
17
+ * derived from this software without specific prior written permission.
18
+ *
19
+ *
20
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
21
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
24
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
27
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7
30
*
8
31
*/
9
32
18
41
#include "nrf.h"
19
42
#include "app_error.h"
20
43
44
+ #ifdef __cplusplus
45
+ extern "C" {
46
+ #endif
47
+
21
48
#if defined(DEBUG_NRF ) || defined(DEBUG_NRF_USER )
22
49
23
50
/** @brief Function for handling assertions.
38
65
*/
39
66
void assert_nrf_callback (uint16_t line_num , const uint8_t * file_name );
40
67
41
- /*lint -emacro(506, ASSERT) */ /* Suppress "Constant value Boolean */
68
+ /*lint -emacro(506, ASSERT) */ /* Suppress "Constant value Boolean */
42
69
/*lint -emacro(774, ASSERT) */ /* Suppress "Boolean within 'if' always evaluates to True" */ \
43
70
44
71
/** @brief Function for checking intended for production code.
@@ -53,8 +80,14 @@ else \
53
80
assert_nrf_callback((uint16_t)__LINE__, (uint8_t *)__FILE__); \
54
81
}
55
82
#else
83
+ #ifndef ASSERT
56
84
#define ASSERT (expr ) //!< Assert empty when disabled
57
85
__WEAK void assert_nrf_callback (uint16_t line_num , const uint8_t * file_name );
86
+ #endif
58
87
#endif /* defined(DEBUG_NRF) || defined(DEBUG_NRF_USER) */
59
88
89
+ #ifdef __cplusplus
90
+ }
91
+ #endif
92
+
60
93
#endif /* NRF_ASSERT_H_ */
0 commit comments