ErrorLib 1.0.8-master SHA: 810228da25
Actions on Error set and reset

The reaction what happens if an error is raised can be set for every single error. An error reset reaction can be defined, too. These reactions must be defined once and can be used by more than one errors.

Example for a definition of an error reaction:

DefineOnErrorReaction(TestErrorReaction, // Function to be called
"Test Error Reaction", // Name of the function
"DOC_D Dies ist eine Testbeschreibung. Verweis auf den "PARA(PARA_ID_Identifikation)". "\
"Blah blah."\
"DOC_E Test Error-Reaction. Link to Parameter Identification "PARA(PARA_ID_Identifikation)". "\
"Blah blah.")
void TestErrorReaction(void)
{
LogMessage("Test Error-Reaction was fired.", LOGMESSAGE_OPTION_DEBUG);
}
#define LogMessage(message, Options)
Print a message with defined options.
Definition: LogMessage.h:71
#define LOGMESSAGE_OPTION_DEBUG
This message is only for debug purposes. The user can fadeout this messages if not required.
Definition: LogMessage.h:36
DefineOnErrorReaction(TestErrorReaction, "Test Error Reaction", "DOC_D Dies ist eine Testbeschreibung. Verweis auf den "PARA_STR(PARA_ID_Identifikation)". " "Blah blah." "DOC_E Test Error-Reaction. Link to Parameter Identification "PARA_STR(PARA_ID_Identifikation)". " "Blah blah.")
Definition of a sample Error-Reaction.
Definition: Sample_Errors.c:22

The definition of an error reaction containes of a macro dto set the metadata and a function, which is called after the error is raised. The parameters of the definition-macro are:

  • Name of the function to be called
  • Name of the error reaction. This name is shown in the helptext of the error on PC
  • The helptext is shown on pc after pressing F1. It can contain several lines in german and english. See page Help-texts in Errors for details.

An error reset reaction can be defined analog. This can be useful for example if an integrator or special hardware has to resetted. Example for a reset reaction:

DefineOnErrorResetReaction(TestErrorResetReaction, // Function to be called
"Test Error Reset Reaction", // Name of the function
"DOC_D Dies ist eine Testbeschreibung. Verweis auf den "PARA(PARA_ID_Identifikation)". "\
"Blah blah."\
"DOC_E Test Error-Reset-Reaction. Link to Parameter Identification "PARA(PARA_ID_Identifikation)". "\
"Blah blah.")
void TestErrorResetReaction(void)
{
//code will be executed on error reset
}
#define DefineOnErrorResetReaction(ERROR_REACTION, NAME, HELP)
Define an error reset reaction.
Definition: Error.h:898