Xmega IEC60730 Class B Library  1.0
 All Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
error_handler.h File Reference

Detailed Description

Macros and definitions for handling errors and other configurable actions.

Application note:
AVR1610: Guide to IEC60730 Class B compliance with XMEGA
Documentation
For comprehensive code documentation, supported compilers, compiler settings and supported devices see readme.html
Author:
Atmel Corporation: http://www.atmel.com
Support email: avr@a.nosp@m.tmel.nosp@m..com

Copyright (C) 2012 Atmel Corporation. All rights reserved.

Definition in file error_handler.h.

#include "avr_compiler.h"
+ Include dependency graph for error_handler.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

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.

Variables

Global variables defined in the main application.
NO_INIT volatile uint8_t classb_error
 The global error flag in the examples.