Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of nRF51822 by
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 #include "nordic_global.h" 00018 00019 /** @brief This function handles assertions. 00020 * 00021 * 00022 * @note 00023 * This function is called when an assertion has triggered. 00024 * 00025 * 00026 * @param line_num The line number where the assertion is called 00027 * @param file_name Pointer to the file name 00028 */ 00029 void assert_softdevice_callback(uint16_t line_num, const uint8_t *file_name); 00030 00031 00032 /*lint -emacro(506, ASSERT) */ /* Suppress "Constant value Boolean */ 00033 /*lint -emacro(774, ASSERT) */ /* Suppress "Boolean within 'if' always evaluates to True" */ \ 00034 /** @brief Check intended for production code 00035 * 00036 * Check passes if "expr" evaluates to true. */ 00037 #define ASSERT(expr) \ 00038 if (expr) \ 00039 { \ 00040 } \ 00041 else \ 00042 { \ 00043 assert_softdevice_callback((uint16_t)__LINE__, (uint8_t *)__FILE__); \ 00044 /*lint -unreachable */ \ 00045 } 00046 00047 #endif /* SOFTDEVICE_ASSERT_H_ */
Generated on Tue Jul 12 2022 19:00:52 by
