nRF51 SDK - S130 SoftDevice
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Common application error handler

Common application error handler and macros for utilizing a common error handler. More...

Macros

#define APP_ERROR_HANDLER(ERR_CODE)
 Macro for calling error handler function. More...
 
#define APP_ERROR_CHECK(ERR_CODE)
 Macro for calling error handler function if supplied error code any other than NRF_SUCCESS. More...
 
#define APP_ERROR_CHECK_BOOL(BOOLEAN_VALUE)
 Macro for calling error handler function if supplied boolean value is false. More...
 

Functions

void app_error_handler (uint32_t error_code, uint32_t line_num, const uint8_t *p_file_name)
 Function for error handling, which is called when an error has occurred. More...
 

Detailed Description

Common application error handler and macros for utilizing a common error handler.

Macro Definition Documentation

#define APP_ERROR_CHECK (   ERR_CODE)
Value:
do \
{ \
const uint32_t LOCAL_ERR_CODE = (ERR_CODE); \
if (LOCAL_ERR_CODE != NRF_SUCCESS) \
{ \
APP_ERROR_HANDLER(LOCAL_ERR_CODE); \
} \
} while (0)

Macro for calling error handler function if supplied error code any other than NRF_SUCCESS.

Parameters
[in]ERR_CODEError code supplied to the error handler.
#define APP_ERROR_CHECK_BOOL (   BOOLEAN_VALUE)
Value:
do \
{ \
const uint32_t LOCAL_BOOLEAN_VALUE = (BOOLEAN_VALUE); \
if (!LOCAL_BOOLEAN_VALUE) \
{ \
APP_ERROR_HANDLER(0); \
} \
} while (0)

Macro for calling error handler function if supplied boolean value is false.

Parameters
[in]BOOLEAN_VALUEBoolean value to be evaluated.
#define APP_ERROR_HANDLER (   ERR_CODE)
Value:
do \
{ \
app_error_handler((ERR_CODE), 0, 0); \
} while (0)

Macro for calling error handler function.

Parameters
[in]ERR_CODEError code supplied to the error handler.

Function Documentation

void app_error_handler ( uint32_t  error_code,
uint32_t  line_num,
const uint8_t *  p_file_name 
)

Function for error handling, which is called when an error has occurred.

Parameters
[in]error_codeError code supplied to the handler.
[in]line_numLine number where the handler is called.
[in]p_file_namePointer to the file name.