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 /* Copyright (c) 2014 Nordic Semiconductor. All Rights Reserved.
rgrover1 361:d2405f5a4853 2 *
rgrover1 361:d2405f5a4853 3 * The information contained herein is property of Nordic Semiconductor ASA.
rgrover1 361:d2405f5a4853 4 * Terms and conditions of usage are described in detail in NORDIC
rgrover1 361:d2405f5a4853 5 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
rgrover1 361:d2405f5a4853 6 *
rgrover1 361:d2405f5a4853 7 * Licensees are granted free, non-transferable use of the information. NO
rgrover1 361:d2405f5a4853 8 * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
rgrover1 361:d2405f5a4853 9 * the file.
rgrover1 361:d2405f5a4853 10 *
rgrover1 361:d2405f5a4853 11 */
rgrover1 361:d2405f5a4853 12
rgrover1 361:d2405f5a4853 13 /** @file
rgrover1 361:d2405f5a4853 14 *
rgrover1 361:d2405f5a4853 15 * @defgroup app_error Common application error handler
rgrover1 361:d2405f5a4853 16 * @{
rgrover1 361:d2405f5a4853 17 * @ingroup app_common
rgrover1 361:d2405f5a4853 18 *
rgrover1 361:d2405f5a4853 19 * @brief Common application error handler.
rgrover1 361:d2405f5a4853 20 */
rgrover1 361:d2405f5a4853 21
rgrover1 361:d2405f5a4853 22 #include "nrf.h"
rgrover1 361:d2405f5a4853 23 #include "app_error.h"
rgrover1 361:d2405f5a4853 24 #include "compiler_abstraction.h"
rgrover1 361:d2405f5a4853 25 #include "nordic_common.h"
rgrover1 361:d2405f5a4853 26 #ifdef DEBUG
rgrover1 361:d2405f5a4853 27 #include "bsp.h"
rgrover1 361:d2405f5a4853 28
rgrover1 361:d2405f5a4853 29 /* global error variables - in order to prevent removal by optimizers */
rgrover1 361:d2405f5a4853 30 uint32_t m_error_code;
rgrover1 361:d2405f5a4853 31 uint32_t m_line_num;
rgrover1 361:d2405f5a4853 32 const uint8_t * m_p_file_name;
rgrover1 361:d2405f5a4853 33 #endif
rgrover1 361:d2405f5a4853 34
rgrover1 361:d2405f5a4853 35 /**@brief Function for error handling, which is called when an error has occurred.
rgrover1 361:d2405f5a4853 36 *
rgrover1 361:d2405f5a4853 37 * @warning This handler is an example only and does not fit a final product. You need to analyze
rgrover1 361:d2405f5a4853 38 * how your product is supposed to react in case of error.
rgrover1 361:d2405f5a4853 39 *
rgrover1 361:d2405f5a4853 40 * @param[in] error_code Error code supplied to the handler.
rgrover1 361:d2405f5a4853 41 * @param[in] line_num Line number where the handler is called.
rgrover1 361:d2405f5a4853 42 * @param[in] p_file_name Pointer to the file name.
rgrover1 361:d2405f5a4853 43 *
rgrover1 361:d2405f5a4853 44 * Function is implemented as weak so that it can be overwritten by custom application error handler
rgrover1 361:d2405f5a4853 45 * when needed.
rgrover1 361:d2405f5a4853 46 */
rgrover1 361:d2405f5a4853 47
rgrover1 361:d2405f5a4853 48 /*lint -save -e14 */
rgrover1 361:d2405f5a4853 49 __WEAK void app_error_handler(uint32_t error_code, uint32_t line_num, const uint8_t * p_file_name)
rgrover1 361:d2405f5a4853 50 {
rgrover1 361:d2405f5a4853 51 // On assert, the system can only recover with a reset.
rgrover1 361:d2405f5a4853 52 #ifndef DEBUG
rgrover1 361:d2405f5a4853 53 NVIC_SystemReset();
rgrover1 361:d2405f5a4853 54 #else
rgrover1 361:d2405f5a4853 55
rgrover1 361:d2405f5a4853 56 #ifdef BSP_DEFINES_ONLY
rgrover1 361:d2405f5a4853 57 LEDS_ON(LEDS_MASK);
rgrover1 361:d2405f5a4853 58 #else
rgrover1 361:d2405f5a4853 59 UNUSED_VARIABLE(bsp_indication_set(BSP_INDICATE_FATAL_ERROR));
rgrover1 361:d2405f5a4853 60 // This call can be used for debug purposes during application development.
rgrover1 361:d2405f5a4853 61 // @note CAUTION: Activating this code will write the stack to flash on an error.
rgrover1 361:d2405f5a4853 62 // This function should NOT be used in a final product.
rgrover1 361:d2405f5a4853 63 // It is intended STRICTLY for development/debugging purposes.
rgrover1 361:d2405f5a4853 64 // The flash write will happen EVEN if the radio is active, thus interrupting
rgrover1 361:d2405f5a4853 65 // any communication.
rgrover1 361:d2405f5a4853 66 // Use with care. Uncomment the line below to use.
rgrover1 361:d2405f5a4853 67 //ble_debug_assert_handler(error_code, line_num, p_file_name);
rgrover1 361:d2405f5a4853 68 #endif // BSP_DEFINES_ONLY
rgrover1 361:d2405f5a4853 69
rgrover1 361:d2405f5a4853 70 m_error_code = error_code;
rgrover1 361:d2405f5a4853 71 m_line_num = line_num;
rgrover1 361:d2405f5a4853 72 m_p_file_name = p_file_name;
rgrover1 361:d2405f5a4853 73
rgrover1 361:d2405f5a4853 74 UNUSED_VARIABLE(m_error_code);
rgrover1 361:d2405f5a4853 75 UNUSED_VARIABLE(m_line_num);
rgrover1 361:d2405f5a4853 76 UNUSED_VARIABLE(m_p_file_name);
rgrover1 361:d2405f5a4853 77 __disable_irq();
rgrover1 361:d2405f5a4853 78 while(1) ;
rgrover1 361:d2405f5a4853 79 #endif // DEBUG
rgrover1 361:d2405f5a4853 80 }
rgrover1 361:d2405f5a4853 81 /*lint -restore */