Xmega IEC60730 Class B Library  1.0
 All Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Error Handling

Detailed Description

Definitions related to error handling for Class B tests.

In order to make the library as flexible as possible, the user can configure the response to the different errors that can appear during the tests. Therefore, the user is responsible to handle the errors in a way such that the application is safe and reliable.

Global variables defined in the main application.

NO_INIT volatile uint8_t classb_error
 The global error flag in the examples.

Error handlers for Class B tests.

These are the statements that should be run if a test fails.

Note:
The statements need to be declared as:
  • do{<statements>}while(0) or similar.
  • Example: in order to hang the device it is possible to set do{}while(1).
#define CLASSB_ERROR_HANDLER_ANALOG()   do{classb_error = 1;}while(0)
 Error handler for the ADC, DAC and analog multiplexer test.
#define CLASSB_ERROR_HANDLER_CRC()   do{classb_error = 1;}while(0)
 Error handler for the CRC test.
#define CLASSB_ERROR_HANDLER_FREQ()   do{classb_error = 1;}while(0)
 Error handler for the CPU frequency test.
#define CLASSB_ERROR_HANDLER_INTERRUPT()   do{classb_error = 1;}while(0)
 Error handler for the interrupt monitor.
#define CLASSB_ERROR_HANDLER_REGISTERS()   do{classb_error = 1;}while(0)
 Error handler for the CPU registers test.
#define CLASSB_ERROR_HANDLER_SRAM()   do{classb_error = 1;}while(0)
 Error handler for the SRAM test.
#define CLASSB_ERROR_HANDLER_WDT()   do{}while(1)
 Error handler for watchdog timer test.

Configurable actions and conditions for Class B tests.

Some test have a configurable behavior.

Note:
  • The conditions should be declared as: (<condition>).
  • Statements need to be declared as: do{<statements>}while(0) or similar.
  • Example: in order to hang the device it is possible to set: do{}while(1).
#define CLASSB_CONDITION1_INTERRUPT   (!classb_error)
 Condition to assign a new state.
#define CLASSB_CONDITION2_INTERRUPT   (classb_error)
 Condition to stop checking interrupts within the monitor.
#define CLASSB_ACTIONS_RTC()   ;
 Configurable actions in the RTC interrupt.
#define CLASSB_ACTIONS_WDT_RUNTIME_FAILURE()
 First group of configurable actions in the watchdog timer test.
#define CLASSB_ACTIONS_WDT_OTHER_FAILURE()   do{}while(0)
 Second group of configurable actions in the watchdog timer test.

Variable Documentation

NO_INIT volatile uint8_t classb_error

The global error flag in the examples.

The global error flag in the examples.

Global error flag.

Definition at line 56 of file analog/UserApplication.c.

Referenced by classb_wdt_test(), and main().