@@ -941,14 +941,14 @@ MBED_NORETURN void error(const char *format, ...) MBED_PRINTF(1, 2);
941941#define MBED_MAKE_ERROR (module , error_code ) MBED_MAKE_SYSTEM_ERROR(module, error_code)
942942
943943/**
944- * Callback/Error hook function prototype. Applications needing a callback when an error is reported can use mbed_set_error_hook function
945- * to register a callback/error hook function using the following prototype . When an error happens in the system error handling
944+ * Callback/Error hook function. If application implementation needs to receive this callback when an error is reported,
945+ * mbed_error_hook function should be overridden with custom implementation . When an error happens in the system error handling
946946 * implementation will invoke this callback with the mbed_error_status_t reported and the error context at the time of error.
947947 * @param error_ctx Error context structure associated with this error.
948948 * @return void
949949 *
950950 */
951- typedef void ( * mbed_error_hook_t )( const mbed_error_ctx * error_ctx );
951+ void mbed_error_hook ( const mbed_error_ctx * error_context );
952952
953953
954954/**
@@ -1070,28 +1070,6 @@ bool mbed_get_error_in_progress(void);
10701070 */
10711071MBED_NORETURN mbed_error_status_t mbed_error (mbed_error_status_t error_status , const char * error_msg , unsigned int error_value , const char * filename , int line_number );
10721072
1073- /**
1074- * Registers an application defined error callback with the error handling system.
1075- * This function will be called with error context info whenever system handles a mbed_error/mbed_warning call
1076- * NOTE: This function should be implemented for re-entrancy as multiple threads may invoke mbed_error which may cause error hook to be called.
1077- * @param custom_error_hook mbed_error_status_t status to be set(See mbed_error_status_t enum above for available error status values).
1078- * @return 0 or MBED_SUCCESS on success.
1079- * MBED_ERROR_INVALID_ARGUMENT in case of NULL for custom_error_hook
1080- *
1081- * @code
1082- *
1083- * mbed_error_status_t my_custom_error_hook(mbed_error_status_t error_status, const mbed_error_ctx *error_ctx) {
1084- * //Do something with the error_status or error_ctx
1085- * }
1086- *
1087- * mbed_set_error_hook( my_custom_error_hook )
1088- *
1089- * @endcode
1090- * @note The erro hook function implementation should be re-entrant.
1091- *
1092- */
1093- mbed_error_status_t mbed_set_error_hook (mbed_error_hook_t custom_error_hook );
1094-
10951073/**
10961074 * Reads the first error context information captured.
10971075 * @param error_info This is the mbed_error_context info captured as part of the first mbed_error call. The caller should pass a pointer to mbed_error_context struct allocated by the caller.
0 commit comments