nochanges

Dependents:   BLE_Acceleration_Statejudging

Fork of nRF51822 by Nordic Semiconductor

Committer:
Rohit Grover
Date:
Mon Jul 07 13:43:31 2014 +0100
Revision:
37:c29c330d942c
Parent:
0:eff01767de02
Child:
49:c941433e0eb0
changes required to upgrade to V7 of the soft-device

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 *
bogdanm 0:eff01767de02 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 */
bogdanm 0:eff01767de02 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
bogdanm 0:eff01767de02 29 /**@brief Function for error handling, which is called when an error has occurred.
bogdanm 0:eff01767de02 30 *
bogdanm 0:eff01767de02 31 * @param[in] error_code Error code supplied to the handler.
bogdanm 0:eff01767de02 32 * @param[in] line_num Line number where the handler is called.
bogdanm 0:eff01767de02 33 * @param[in] p_file_name Pointer to the file name.
bogdanm 0:eff01767de02 34 */
bogdanm 0:eff01767de02 35 void app_error_handler(uint32_t error_code, uint32_t line_num, const uint8_t * p_file_name);
bogdanm 0:eff01767de02 36
bogdanm 0:eff01767de02 37 /**@brief Macro for calling error handler function.
bogdanm 0:eff01767de02 38 *
bogdanm 0:eff01767de02 39 * @param[in] ERR_CODE Error code supplied to the error handler.
bogdanm 0:eff01767de02 40 */
bogdanm 0:eff01767de02 41 #define APP_ERROR_HANDLER(ERR_CODE) \
bogdanm 0:eff01767de02 42 do \
bogdanm 0:eff01767de02 43 { \
bogdanm 0:eff01767de02 44 app_error_handler((ERR_CODE), __LINE__, (uint8_t*) __FILE__); \
bogdanm 0:eff01767de02 45 } while (0)
bogdanm 0:eff01767de02 46
bogdanm 0:eff01767de02 47 /**@brief Macro for calling error handler function if supplied error code any other than NRF_SUCCESS.
bogdanm 0:eff01767de02 48 *
bogdanm 0:eff01767de02 49 * @param[in] ERR_CODE Error code supplied to the error handler.
bogdanm 0:eff01767de02 50 */
bogdanm 0:eff01767de02 51 #define APP_ERROR_CHECK(ERR_CODE) \
bogdanm 0:eff01767de02 52 do \
bogdanm 0:eff01767de02 53 { \
bogdanm 0:eff01767de02 54 const uint32_t LOCAL_ERR_CODE = (ERR_CODE); \
bogdanm 0:eff01767de02 55 if (LOCAL_ERR_CODE != NRF_SUCCESS) \
bogdanm 0:eff01767de02 56 { \
bogdanm 0:eff01767de02 57 APP_ERROR_HANDLER(LOCAL_ERR_CODE); \
bogdanm 0:eff01767de02 58 } \
bogdanm 0:eff01767de02 59 } while (0)
bogdanm 0:eff01767de02 60
bogdanm 0:eff01767de02 61 /**@brief Macro for calling error handler function if supplied boolean value is false.
bogdanm 0:eff01767de02 62 *
bogdanm 0:eff01767de02 63 * @param[in] BOOLEAN_VALUE Boolean value to be evaluated.
bogdanm 0:eff01767de02 64 */
bogdanm 0:eff01767de02 65 #define APP_ERROR_CHECK_BOOL(BOOLEAN_VALUE) \
bogdanm 0:eff01767de02 66 do \
bogdanm 0:eff01767de02 67 { \
bogdanm 0:eff01767de02 68 const bool LOCAL_BOOLEAN_VALUE = (BOOLEAN_VALUE); \
bogdanm 0:eff01767de02 69 if (!LOCAL_BOOLEAN_VALUE) \
bogdanm 0:eff01767de02 70 { \
bogdanm 0:eff01767de02 71 APP_ERROR_HANDLER(0); \
bogdanm 0:eff01767de02 72 } \
bogdanm 0:eff01767de02 73 } while (0)
bogdanm 0:eff01767de02 74
bogdanm 0:eff01767de02 75 #endif // APP_ERROR_H__
bogdanm 0:eff01767de02 76
bogdanm 0:eff01767de02 77 /** @} */