Atmel Software Framework

error_handler.h File Reference

Macros and definitions for handling errors and other configurable actions.

Application note:
AVR1610: Guide to IEC60730 Class B compliance with XMEGA

Copyright (C) 2011-2015 Atmel Corporation. All rights reserved.

#include <asf.h>

Macros

#define NO_INIT   __attribute__ ((section (".noinit")))
 Macro for telling the compiler not to initialize a variable on restart. More...
 
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()
 Error handler for the ADC, DAC and analog multiplexer test. More...
 
#define CLASSB_ERROR_HANDLER_CRC()
 Error handler for the CRC test. More...
 
#define CLASSB_ERROR_HANDLER_FREQ()
 Error handler for the CPU frequency test. More...
 
#define CLASSB_ERROR_HANDLER_INTERRUPT()
 Error handler for the interrupt monitor. More...
 
#define CLASSB_ERROR_HANDLER_REGISTERS()
 Error handler for the CPU registers test. More...
 
#define CLASSB_ERROR_HANDLER_SRAM()
 Error handler for the SRAM test. More...
 
#define CLASSB_ERROR_HANDLER_WDT()
 Error handler for watchdog timer test. More...
 
Configurable actions and conditions for Class B tests.

Some tests 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. More...
 
#define CLASSB_CONDITION2_INTERRUPT   (classb_error)
 Condition to stop checking interrupts within the monitor. More...
 
#define CLASSB_ACTIONS_RTC()   ;
 Configurable actions in the RTC interrupt. More...
 
#define CLASSB_ACTIONS_WDT_RUNTIME_FAILURE()
 First group of configurable actions in the watchdog timer test. More...
 
#define CLASSB_ACTIONS_WDT_OTHER_FAILURE()   do{ } while (0)
 Second group of configurable actions in the watchdog timer test. More...
 

Enumerations

enum  classb_error_value {
  CLASSB_ERROR_NONE = 0x00,
  CLASSB_ERROR_WDT = 0x01,
  CLASSB_ERROR_ANALOG = 0x02,
  CLASSB_ERROR_CRC = 0x04,
  CLASSB_ERROR_FREQ = 0x08,
  CLASSB_ERROR_INT = 0x10,
  CLASSB_ERROR_CPU = 0x20,
  CLASSB_ERROR_SRAM = 0x40,
  CLASSB_ERROR_OTHER = 0x80
}
 Class B error values for the global error variable. More...
 

Variables

Global variables defined in the main application.
NO_INIT enum classb_error_value classb_error
 Global error indicator, defined in main.c. More...
 

#define NO_INIT   __attribute__ ((section (".noinit")))

Macro for telling the compiler not to initialize a variable on restart.