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.
Dependents: microbit_rubber_ducky microbit_mouse_BLE microbit_mouse_BLE_daybreak_version microbit_presenter
Fork of nRF51822 by
nordic-sdk/components/libraries/util/nrf_assert.h@370:295f76db798e, 2015-07-06 (annotated)
- Committer:
- rgrover1
- Date:
- Mon Jul 06 10:13:26 2015 +0100
- Revision:
- 370:295f76db798e
- Parent:
- 362:6fa0d4d555f6
- Child:
- 371:8f7d2137727a
Synchronized with git rev 9f72c4ba
Author: Rohit Grover
Release 0.3.7
=============
This is a minor set of enhancements mostly around reduce our global static
memory footprint.
Enhancements
~~~~~~~~~~~~
* Reduce the maximum number of CHARACTERISTICS and DESCRIPTORS that can be
handled. This has memory implications for static global memory. It should
be possible to re-architect our solution for add_characteristic() to not
require these limits; hopefully we'll get there soon.
* Move nRF51GattServer::getInstance() into a .cpp file; same for nRF51Gap::getInstance().
* Reduce max bonds to managed by device-manager to 4; this has memory implications for static global memory.
* Reduce pStorage command queue size to 2; this has memory implications for static global memory.
* Replace uses of deprecated Gap::addr_type_t with Gap::AddressType_t.
* Some UUID-related types have moved into UUID class. Minor changes were needed to work around build errors.
Bugfixes
~~~~~~~~
* None.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| rgrover1 | 370:295f76db798e | 1 | /* |
| rgrover1 | 370:295f76db798e | 2 | * Copyright (c) 2006 Nordic Semiconductor. All Rights Reserved. |
| rgrover1 | 370:295f76db798e | 3 | * |
| rgrover1 | 370:295f76db798e | 4 | * The information contained herein is confidential property of Nordic Semiconductor. The use, |
| rgrover1 | 370:295f76db798e | 5 | * copying, transfer or disclosure of such information is prohibited except by express written |
| rgrover1 | 370:295f76db798e | 6 | * agreement with Nordic Semiconductor. |
| rgrover1 | 370:295f76db798e | 7 | * |
| rgrover1 | 370:295f76db798e | 8 | */ |
| rgrover1 | 370:295f76db798e | 9 | |
| rgrover1 | 370:295f76db798e | 10 | /** @file |
| rgrover1 | 370:295f76db798e | 11 | * @brief Utilities for verifying program logic |
| rgrover1 | 370:295f76db798e | 12 | */ |
| rgrover1 | 370:295f76db798e | 13 | |
| rgrover1 | 370:295f76db798e | 14 | #ifndef NRF_ASSERT_H_ |
| rgrover1 | 370:295f76db798e | 15 | #define NRF_ASSERT_H_ |
| rgrover1 | 370:295f76db798e | 16 | |
| rgrover1 | 370:295f76db798e | 17 | #include <stdint.h> |
| rgrover1 | 370:295f76db798e | 18 | #include "compiler_abstraction.h" |
| rgrover1 | 370:295f76db798e | 19 | #ifdef __cplusplus |
| rgrover1 | 370:295f76db798e | 20 | extern "C" { |
| rgrover1 | 370:295f76db798e | 21 | #endif |
| rgrover1 | 370:295f76db798e | 22 | |
| rgrover1 | 370:295f76db798e | 23 | #if defined(DEBUG_NRF) || defined(DEBUG_NRF_USER) |
| rgrover1 | 370:295f76db798e | 24 | |
| rgrover1 | 370:295f76db798e | 25 | /** @brief Function for handling assertions. |
| rgrover1 | 370:295f76db798e | 26 | * |
| rgrover1 | 370:295f76db798e | 27 | * |
| rgrover1 | 370:295f76db798e | 28 | * @note |
| rgrover1 | 370:295f76db798e | 29 | * This function is called when an assertion has triggered. |
| rgrover1 | 370:295f76db798e | 30 | * |
| rgrover1 | 370:295f76db798e | 31 | * |
| rgrover1 | 370:295f76db798e | 32 | * @post |
| rgrover1 | 370:295f76db798e | 33 | * All hardware is put into an idle non-emitting state (in particular the radio is highly |
| rgrover1 | 370:295f76db798e | 34 | * important to switch off since the radio might be in a state that makes it send |
| rgrover1 | 370:295f76db798e | 35 | * packets continiously while a typical final infinit ASSERT loop is executing). |
| rgrover1 | 370:295f76db798e | 36 | * |
| rgrover1 | 370:295f76db798e | 37 | * |
| rgrover1 | 370:295f76db798e | 38 | * @param line_num The line number where the assertion is called |
| rgrover1 | 370:295f76db798e | 39 | * @param file_name Pointer to the file name |
| rgrover1 | 370:295f76db798e | 40 | */ |
| rgrover1 | 370:295f76db798e | 41 | void assert_nrf_callback(uint16_t line_num, const uint8_t *file_name); |
| rgrover1 | 370:295f76db798e | 42 | |
| rgrover1 | 370:295f76db798e | 43 | /*lint -emacro(506, ASSERT) */ /* Suppress "Constant value Boolean */ |
| rgrover1 | 370:295f76db798e | 44 | /*lint -emacro(774, ASSERT) */ /* Suppress "Boolean within 'if' always evaluates to True" */ \ |
| rgrover1 | 370:295f76db798e | 45 | |
| rgrover1 | 370:295f76db798e | 46 | /** @brief Function for checking intended for production code. |
| rgrover1 | 370:295f76db798e | 47 | * |
| rgrover1 | 370:295f76db798e | 48 | * Check passes if "expr" evaluates to true. */ |
| rgrover1 | 370:295f76db798e | 49 | #define ASSERT(expr) \ |
| rgrover1 | 370:295f76db798e | 50 | if (expr) \ |
| rgrover1 | 370:295f76db798e | 51 | { \ |
| rgrover1 | 370:295f76db798e | 52 | } \ |
| rgrover1 | 370:295f76db798e | 53 | else \ |
| rgrover1 | 370:295f76db798e | 54 | { \ |
| rgrover1 | 370:295f76db798e | 55 | assert_nrf_callback((uint16_t)__LINE__, (uint8_t *)__FILE__); \ |
| rgrover1 | 370:295f76db798e | 56 | } |
| rgrover1 | 370:295f76db798e | 57 | #else |
| rgrover1 | 370:295f76db798e | 58 | #define ASSERT(expr) //!< Assert empty when disabled |
| rgrover1 | 370:295f76db798e | 59 | __WEAK void assert_nrf_callback(uint16_t line_num, const uint8_t *file_name); |
| rgrover1 | 370:295f76db798e | 60 | #endif /* defined(DEBUG_NRF) || defined(DEBUG_NRF_USER) */ |
| rgrover1 | 370:295f76db798e | 61 | |
| rgrover1 | 370:295f76db798e | 62 | #ifdef __cplusplus |
| rgrover1 | 370:295f76db798e | 63 | } |
| rgrover1 | 370:295f76db798e | 64 | #endif |
| rgrover1 | 370:295f76db798e | 65 | |
| rgrover1 | 370:295f76db798e | 66 | #endif /* NRF_ASSERT_H_ */ |
