nochanges

Dependents:   BLE_Acceleration_Statejudging

Fork of nRF51822 by Nordic Semiconductor

Committer:
Rohit Grover
Date:
Mon Sep 08 17:21:46 2014 +0100
Revision:
65:98215c4f3a25
Parent:
49:c941433e0eb0
Release 0.1.3

Update to v6.1.0 of Nordic's SDK.

Bugfixes
~~~~~~~~

- Handle all valid disconnection reasons.

Compatible with Release 0.1.1 of the BLE_API.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bogdanm 0:eff01767de02 1 /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved.
bogdanm 0:eff01767de02 2 *
Rohit Grover 65:98215c4f3a25 3 * The information contained herein is property of Nordic Semiconductor ASA.
bogdanm 0:eff01767de02 4 * Terms and conditions of usage are described in detail in NORDIC
bogdanm 0:eff01767de02 5 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
bogdanm 0:eff01767de02 6 *
bogdanm 0:eff01767de02 7 * Licensees are granted free, non-transferable use of the information. NO
bogdanm 0:eff01767de02 8 * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
bogdanm 0:eff01767de02 9 * the file.
bogdanm 0:eff01767de02 10 *
bogdanm 0:eff01767de02 11 */
Rohit Grover 65:98215c4f3a25 12
bogdanm 0:eff01767de02 13 /** @file
bogdanm 0:eff01767de02 14 *
bogdanm 0:eff01767de02 15 * @defgroup app_error Common application error handler
bogdanm 0:eff01767de02 16 * @{
bogdanm 0:eff01767de02 17 * @ingroup app_common
bogdanm 0:eff01767de02 18 *
bogdanm 0:eff01767de02 19 * @brief Common application error handler and macros for utilizing a common error handler.
bogdanm 0:eff01767de02 20 */
bogdanm 0:eff01767de02 21
bogdanm 0:eff01767de02 22 #ifndef APP_ERROR_H__
bogdanm 0:eff01767de02 23 #define APP_ERROR_H__
bogdanm 0:eff01767de02 24
bogdanm 0:eff01767de02 25 #include <stdint.h>
bogdanm 0:eff01767de02 26 #include <stdbool.h>
bogdanm 0:eff01767de02 27 #include "nrf_error.h"
bogdanm 0:eff01767de02 28
Rohit Grover 49:c941433e0eb0 29 #ifdef __cplusplus
Rohit Grover 49:c941433e0eb0 30 extern "C" {
Rohit Grover 49:c941433e0eb0 31 #endif
Rohit Grover 49:c941433e0eb0 32
Rohit Grover 65:98215c4f3a25 33 /**@brief Function for error handling, which is called when an error has occurred.
bogdanm 0:eff01767de02 34 *
bogdanm 0:eff01767de02 35 * @param[in] error_code Error code supplied to the handler.
bogdanm 0:eff01767de02 36 * @param[in] line_num Line number where the handler is called.
Rohit Grover 65:98215c4f3a25 37 * @param[in] p_file_name Pointer to the file name.
bogdanm 0:eff01767de02 38 */
bogdanm 0:eff01767de02 39 void app_error_handler(uint32_t error_code, uint32_t line_num, const uint8_t * p_file_name);
bogdanm 0:eff01767de02 40
Rohit Grover 49:c941433e0eb0 41 #ifdef __cplusplus
Rohit Grover 49:c941433e0eb0 42 }
Rohit Grover 49:c941433e0eb0 43 #endif
Rohit Grover 49:c941433e0eb0 44
Rohit Grover 65:98215c4f3a25 45 /**@brief Macro for calling error handler function.
bogdanm 0:eff01767de02 46 *
bogdanm 0:eff01767de02 47 * @param[in] ERR_CODE Error code supplied to the error handler.
bogdanm 0:eff01767de02 48 */
bogdanm 0:eff01767de02 49 #define APP_ERROR_HANDLER(ERR_CODE) \
bogdanm 0:eff01767de02 50 do \
bogdanm 0:eff01767de02 51 { \
bogdanm 0:eff01767de02 52 app_error_handler((ERR_CODE), __LINE__, (uint8_t*) __FILE__); \
bogdanm 0:eff01767de02 53 } while (0)
bogdanm 0:eff01767de02 54
Rohit Grover 65:98215c4f3a25 55 /**@brief Macro for calling error handler function if supplied error code any other than NRF_SUCCESS.
bogdanm 0:eff01767de02 56 *
bogdanm 0:eff01767de02 57 * @param[in] ERR_CODE Error code supplied to the error handler.
Rohit Grover 65:98215c4f3a25 58 */
bogdanm 0:eff01767de02 59 #define APP_ERROR_CHECK(ERR_CODE) \
bogdanm 0:eff01767de02 60 do \
bogdanm 0:eff01767de02 61 { \
bogdanm 0:eff01767de02 62 const uint32_t LOCAL_ERR_CODE = (ERR_CODE); \
bogdanm 0:eff01767de02 63 if (LOCAL_ERR_CODE != NRF_SUCCESS) \
bogdanm 0:eff01767de02 64 { \
bogdanm 0:eff01767de02 65 APP_ERROR_HANDLER(LOCAL_ERR_CODE); \
bogdanm 0:eff01767de02 66 } \
Rohit Grover 65:98215c4f3a25 67 } while (0)
Rohit Grover 65:98215c4f3a25 68
Rohit Grover 65:98215c4f3a25 69 /**@brief Macro for calling error handler function if supplied boolean value is false.
bogdanm 0:eff01767de02 70 *
bogdanm 0:eff01767de02 71 * @param[in] BOOLEAN_VALUE Boolean value to be evaluated.
Rohit Grover 65:98215c4f3a25 72 */
bogdanm 0:eff01767de02 73 #define APP_ERROR_CHECK_BOOL(BOOLEAN_VALUE) \
bogdanm 0:eff01767de02 74 do \
bogdanm 0:eff01767de02 75 { \
bogdanm 0:eff01767de02 76 const bool LOCAL_BOOLEAN_VALUE = (BOOLEAN_VALUE); \
bogdanm 0:eff01767de02 77 if (!LOCAL_BOOLEAN_VALUE) \
bogdanm 0:eff01767de02 78 { \
bogdanm 0:eff01767de02 79 APP_ERROR_HANDLER(0); \
bogdanm 0:eff01767de02 80 } \
Rohit Grover 65:98215c4f3a25 81 } while (0)
bogdanm 0:eff01767de02 82
bogdanm 0:eff01767de02 83 #endif // APP_ERROR_H__
bogdanm 0:eff01767de02 84
bogdanm 0:eff01767de02 85 /** @} */