Patched version of nrf51822 FOTA compatible driver, with GPTIO disabled, as it clashed with the mbed definitions...

Fork of nRF51822 by Nordic Semiconductor

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers softdevice_assert.h Source File

softdevice_assert.h

00001 /*
00002  * Copyright (c) 2012 Nordic Semiconductor. All Rights Reserved.
00003  *
00004  * The information contained herein is confidential property of Nordic Semiconductor. The use,
00005  * copying, transfer or disclosure of such information is prohibited except by express written
00006  * agreement with Nordic Semiconductor.
00007  *
00008  */
00009 
00010 /** @brief Utilities for verifying program logic
00011  */
00012 
00013 #ifndef SOFTDEVICE_ASSERT_H_
00014 #define SOFTDEVICE_ASSERT_H_
00015 
00016 #include <stdint.h>
00017 
00018 /** @brief This function handles assertions.
00019  *
00020  *
00021  * @note
00022  * This function is called when an assertion has triggered.
00023  * 
00024  *
00025  * @param line_num The line number where the assertion is called
00026  * @param file_name Pointer to the file name
00027  */
00028 void assert_softdevice_callback(uint16_t line_num, const uint8_t *file_name);
00029 
00030 
00031 /*lint -emacro(506, ASSERT) */ /* Suppress "Constant value Boolean */ 
00032 /*lint -emacro(774, ASSERT) */ /* Suppress "Boolean within 'if' always evaluates to True" */ \
00033 /** @brief Check intended for production code
00034  *
00035  * Check passes if "expr" evaluates to true. */
00036 #define ASSERT(expr) \
00037 if (expr)                                                                     \
00038 {                                                                             \
00039 }                                                                             \
00040 else                                                                          \
00041 {                                                                             \
00042   assert_softdevice_callback((uint16_t)__LINE__, (uint8_t *)__FILE__);        \
00043   /*lint -unreachable */                                                      \
00044 }
00045 
00046 #endif /* SOFTDEVICE_ASSERT_H_ */