Common application error handler and macros for utilizing a common error handler.
More...
|
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...
|
|
#define APP_ERROR_HANDLER |
( |
|
ERR_CODE | ) |
|
Value:do \
{ \
app_error_handler((ERR_CODE), __LINE__, (uint8_t*) __FILE__); \
} while (0)
- Parameters
-
[in] | ERR_CODE | Error code supplied to the error handler. |
#define APP_ERROR_CHECK |
( |
|
ERR_CODE | ) |
|
Value:do \
{ \
const uint32_t LOCAL_ERR_CODE = (ERR_CODE); \
{ \
APP_ERROR_HANDLER(LOCAL_ERR_CODE); \
} \
} while (0)
- Parameters
-
[in] | ERR_CODE | Error code supplied to the error handler. |
#define APP_ERROR_CHECK_BOOL |
( |
|
BOOLEAN_VALUE | ) |
|
Value:do \
{ \
const bool LOCAL_BOOLEAN_VALUE = (BOOLEAN_VALUE); \
if (!LOCAL_BOOLEAN_VALUE) \
{ \
APP_ERROR_HANDLER(0); \
} \
} while (0)
- Parameters
-
[in] | BOOLEAN_VALUE | Boolean value to be evaluated. |
void app_error_handler |
( |
uint32_t |
error_code, |
|
|
uint32_t |
line_num, |
|
|
const uint8_t * |
p_file_name |
|
) |
| |
- Parameters
-
[in] | error_code | Error code supplied to the handler. |
[in] | line_num | Line number where the handler is called. |
[in] | p_file_name | Pointer to the file name. |
Function for error handling, which is called when an error has occurred.
- Parameters
-
[in] | error_code | Error code supplied to the handler. |
[in] | line_num | Line number where the error occurred. |
[in] | p_file_name | Pointer to the file name. |
- Warning
- This handler is an example only and does not fit a final product. You need to analyze how your product is supposed to react in case of error.
- Parameters
-
[in] | error_code | Error code supplied to the handler. |
[in] | line_num | Line number where the handler is called. |
[in] | p_file_name | Pointer to the file name. |
Function for error handling, which is called when an error has occurred.
- Parameters
-
[in] | error_code | Error code supplied to the handler. |
[in] | line_num | Line number where the handler is called. |
[in] | p_file_name | Pointer to the file name. |
Function for error handling, which is called when an error has occurred.
- Parameters
-
[in] | error_code | Error code supplied to the handler. |
[in] | line_num | Line number where the error occurred. |
[in] | p_file_name | Pointer to the file name. |
- Warning
- This handler is an example only and does not fit a final product. You need to analyze how your product is supposed to react in case of error.
- Parameters
-
[in] | error_code | Error code supplied to the handler. |
[in] | line_num | Line number where the handler is called. |
[in] | p_file_name | Pointer to the file name. |