Nordic nrf51 sdk sources. Mirrored from https://github.com/ARMmbed/nrf51-sdk.

Dependents:   nRF51822 nRF51822

Committer:
vcoubard
Date:
Thu Apr 07 17:37:56 2016 +0100
Revision:
28:041dac1366b2
Parent:
20:a90c48eb1d30
Child:
29:286940b7ee5a
Synchronized with git rev 012b8118
Author: Liyou Zhou
Pull in files from sdk 10.0

Who changed what in which revision?

UserRevisionLine numberNew contents of line
vcoubard 28:041dac1366b2 1 /*
vcoubard 28:041dac1366b2 2 * Copyright (c) Nordic Semiconductor ASA
vcoubard 28:041dac1366b2 3 * All rights reserved.
vcoubard 28:041dac1366b2 4 *
vcoubard 28:041dac1366b2 5 * Redistribution and use in source and binary forms, with or without modification,
vcoubard 28:041dac1366b2 6 * are permitted provided that the following conditions are met:
vcoubard 28:041dac1366b2 7 *
vcoubard 28:041dac1366b2 8 * 1. Redistributions of source code must retain the above copyright notice, this
vcoubard 28:041dac1366b2 9 * list of conditions and the following disclaimer.
vcoubard 28:041dac1366b2 10 *
vcoubard 28:041dac1366b2 11 * 2. Redistributions in binary form must reproduce the above copyright notice, this
vcoubard 28:041dac1366b2 12 * list of conditions and the following disclaimer in the documentation and/or
vcoubard 28:041dac1366b2 13 * other materials provided with the distribution.
vcoubard 28:041dac1366b2 14 *
vcoubard 28:041dac1366b2 15 * 3. Neither the name of Nordic Semiconductor ASA nor the names of other
vcoubard 28:041dac1366b2 16 * contributors to this software may be used to endorse or promote products
vcoubard 28:041dac1366b2 17 * derived from this software without specific prior written permission.
vcoubard 28:041dac1366b2 18 *
vcoubard 28:041dac1366b2 19 * 4. This software must only be used in a processor manufactured by Nordic
vcoubard 28:041dac1366b2 20 * Semiconductor ASA, or in a processor manufactured by a third party that
vcoubard 28:041dac1366b2 21 * is used in combination with a processor manufactured by Nordic Semiconductor.
vcoubard 28:041dac1366b2 22 *
vcoubard 28:041dac1366b2 23 *
vcoubard 28:041dac1366b2 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
vcoubard 28:041dac1366b2 25 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
vcoubard 28:041dac1366b2 26 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
vcoubard 28:041dac1366b2 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
vcoubard 28:041dac1366b2 28 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
vcoubard 28:041dac1366b2 29 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
vcoubard 28:041dac1366b2 30 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
vcoubard 28:041dac1366b2 31 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
vcoubard 28:041dac1366b2 32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
vcoubard 28:041dac1366b2 33 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
vcoubard 28:041dac1366b2 34 *
vcoubard 1:ebc0e0ef0a11 35 */
vcoubard 1:ebc0e0ef0a11 36
vcoubard 1:ebc0e0ef0a11 37 /** @brief Utilities for verifying program logic
vcoubard 1:ebc0e0ef0a11 38 */
vcoubard 1:ebc0e0ef0a11 39
vcoubard 1:ebc0e0ef0a11 40 #ifndef SOFTDEVICE_ASSERT_H_
vcoubard 1:ebc0e0ef0a11 41 #define SOFTDEVICE_ASSERT_H_
vcoubard 1:ebc0e0ef0a11 42
vcoubard 1:ebc0e0ef0a11 43 #include <stdint.h>
vcoubard 1:ebc0e0ef0a11 44
vcoubard 1:ebc0e0ef0a11 45 /** @brief This function handles assertions.
vcoubard 1:ebc0e0ef0a11 46 *
vcoubard 1:ebc0e0ef0a11 47 *
vcoubard 1:ebc0e0ef0a11 48 * @note
vcoubard 1:ebc0e0ef0a11 49 * This function is called when an assertion has triggered.
vcoubard 1:ebc0e0ef0a11 50 *
vcoubard 1:ebc0e0ef0a11 51 *
vcoubard 1:ebc0e0ef0a11 52 * @param line_num The line number where the assertion is called
vcoubard 1:ebc0e0ef0a11 53 * @param file_name Pointer to the file name
vcoubard 1:ebc0e0ef0a11 54 */
vcoubard 1:ebc0e0ef0a11 55 void assert_softdevice_callback(uint16_t line_num, const uint8_t *file_name);
vcoubard 1:ebc0e0ef0a11 56
vcoubard 1:ebc0e0ef0a11 57
vcoubard 1:ebc0e0ef0a11 58 /*lint -emacro(506, ASSERT) */ /* Suppress "Constant value Boolean */
vcoubard 1:ebc0e0ef0a11 59 /*lint -emacro(774, ASSERT) */ /* Suppress "Boolean within 'if' always evaluates to True" */ \
vcoubard 1:ebc0e0ef0a11 60 /** @brief Check intended for production code
vcoubard 1:ebc0e0ef0a11 61 *
vcoubard 1:ebc0e0ef0a11 62 * Check passes if "expr" evaluates to true. */
vcoubard 1:ebc0e0ef0a11 63 #define ASSERT(expr) \
vcoubard 1:ebc0e0ef0a11 64 if (expr) \
vcoubard 1:ebc0e0ef0a11 65 { \
vcoubard 1:ebc0e0ef0a11 66 } \
vcoubard 1:ebc0e0ef0a11 67 else \
vcoubard 1:ebc0e0ef0a11 68 { \
vcoubard 1:ebc0e0ef0a11 69 assert_softdevice_callback((uint16_t)__LINE__, (uint8_t *)__FILE__); \
vcoubard 1:ebc0e0ef0a11 70 /*lint -unreachable */ \
vcoubard 1:ebc0e0ef0a11 71 }
vcoubard 1:ebc0e0ef0a11 72
vcoubard 1:ebc0e0ef0a11 73 #endif /* SOFTDEVICE_ASSERT_H_ */