Cefn Hoile / nRF51822

Dependencies:   nrf51-sdk

Dependents:   microbit-dal

Fork of nRF51822 by Lancaster University

Committer:
rgrover1
Date:
Thu Jul 02 09:08:44 2015 +0100
Revision:
361:d2405f5a4853
Parent:
346:14b090482fd2
Child:
362:6fa0d4d555f6
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?

UserRevisionLine numberNew contents of line
rgrover1 361:d2405f5a4853 1 /*
rgrover1 361:d2405f5a4853 2 * Copyright (c) 2006 Nordic Semiconductor. All Rights Reserved.
rgrover1 361:d2405f5a4853 3 *
rgrover1 361:d2405f5a4853 4 * The information contained herein is confidential property of Nordic Semiconductor. The use,
rgrover1 361:d2405f5a4853 5 * copying, transfer or disclosure of such information is prohibited except by express written
rgrover1 361:d2405f5a4853 6 * agreement with Nordic Semiconductor.
rgrover1 361:d2405f5a4853 7 *
rgrover1 361:d2405f5a4853 8 */
rgrover1 361:d2405f5a4853 9
rgrover1 361:d2405f5a4853 10 /** @file
rgrover1 361:d2405f5a4853 11 * @brief Utilities for verifying program logic
rgrover1 361:d2405f5a4853 12 */
rgrover1 361:d2405f5a4853 13
rgrover1 361:d2405f5a4853 14 #ifndef NRF_ASSERT_H_
rgrover1 361:d2405f5a4853 15 #define NRF_ASSERT_H_
rgrover1 361:d2405f5a4853 16
rgrover1 361:d2405f5a4853 17 #include <stdint.h>
rgrover1 361:d2405f5a4853 18 #include "compiler_abstraction.h"
rgrover1 361:d2405f5a4853 19 #ifdef __cplusplus
rgrover1 361:d2405f5a4853 20 extern "C" {
rgrover1 361:d2405f5a4853 21 #endif
rgrover1 361:d2405f5a4853 22
rgrover1 361:d2405f5a4853 23 #if defined(DEBUG_NRF) || defined(DEBUG_NRF_USER)
rgrover1 361:d2405f5a4853 24
rgrover1 361:d2405f5a4853 25 /** @brief Function for handling assertions.
rgrover1 361:d2405f5a4853 26 *
rgrover1 361:d2405f5a4853 27 *
rgrover1 361:d2405f5a4853 28 * @note
rgrover1 361:d2405f5a4853 29 * This function is called when an assertion has triggered.
rgrover1 361:d2405f5a4853 30 *
rgrover1 361:d2405f5a4853 31 *
rgrover1 361:d2405f5a4853 32 * @post
rgrover1 361:d2405f5a4853 33 * All hardware is put into an idle non-emitting state (in particular the radio is highly
rgrover1 361:d2405f5a4853 34 * important to switch off since the radio might be in a state that makes it send
rgrover1 361:d2405f5a4853 35 * packets continiously while a typical final infinit ASSERT loop is executing).
rgrover1 361:d2405f5a4853 36 *
rgrover1 361:d2405f5a4853 37 *
rgrover1 361:d2405f5a4853 38 * @param line_num The line number where the assertion is called
rgrover1 361:d2405f5a4853 39 * @param file_name Pointer to the file name
rgrover1 361:d2405f5a4853 40 */
rgrover1 361:d2405f5a4853 41 void assert_nrf_callback(uint16_t line_num, const uint8_t *file_name);
rgrover1 361:d2405f5a4853 42
rgrover1 361:d2405f5a4853 43 /*lint -emacro(506, ASSERT) */ /* Suppress "Constant value Boolean */
rgrover1 361:d2405f5a4853 44 /*lint -emacro(774, ASSERT) */ /* Suppress "Boolean within 'if' always evaluates to True" */ \
rgrover1 361:d2405f5a4853 45
rgrover1 361:d2405f5a4853 46 /** @brief Function for checking intended for production code.
rgrover1 361:d2405f5a4853 47 *
rgrover1 361:d2405f5a4853 48 * Check passes if "expr" evaluates to true. */
rgrover1 361:d2405f5a4853 49 #define ASSERT(expr) \
rgrover1 361:d2405f5a4853 50 if (expr) \
rgrover1 361:d2405f5a4853 51 { \
rgrover1 361:d2405f5a4853 52 } \
rgrover1 361:d2405f5a4853 53 else \
rgrover1 361:d2405f5a4853 54 { \
rgrover1 361:d2405f5a4853 55 assert_nrf_callback((uint16_t)__LINE__, (uint8_t *)__FILE__); \
rgrover1 361:d2405f5a4853 56 }
rgrover1 361:d2405f5a4853 57 #else
rgrover1 361:d2405f5a4853 58 #define ASSERT(expr) //!< Assert empty when disabled
rgrover1 361:d2405f5a4853 59 __WEAK void assert_nrf_callback(uint16_t line_num, const uint8_t *file_name);
rgrover1 361:d2405f5a4853 60 #endif /* defined(DEBUG_NRF) || defined(DEBUG_NRF_USER) */
rgrover1 361:d2405f5a4853 61
rgrover1 361:d2405f5a4853 62 #ifdef __cplusplus
rgrover1 361:d2405f5a4853 63 }
rgrover1 361:d2405f5a4853 64 #endif
rgrover1 361:d2405f5a4853 65
rgrover1 361:d2405f5a4853 66 #endif /* NRF_ASSERT_H_ */