bugfix for duplicate symbol

Fork of nRF51822 by Nordic Semiconductor

Committer:
rgrover1
Date:
Thu Apr 30 08:34:37 2015 +0100
Revision:
112:737b08b3b995
Parent:
103:138bdc859cc9
Synchronized with git rev 4ae92f89
Author: Rohit Grover
porting to v8.0 of the SDK

Who changed what in which revision?

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