| Xmega IEC60730 Class B Library 1.0 |

All Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
Functions
CPU Register test

## Detailed Description

This is the self-test for CPU registers.

## Functions
bool | classb_register_test (void)
| CPU register self-diagnostic routine for AVR GCC.

## Function Documentation

bool classb_register_test | ( | void |  | ) |

CPU register self-diagnostic routine for AVR GCC.

This function tests the CPU registers, preserving those registers specified in the AVR GCC compiler documentation. Note that if there should be a fault in a register that needs preservation, its value would not be restored.

Registers are tested in this order:

1. Critical registers
   1. Return value register: R24
   2. stack pointer: SPL/SPH
   3. register file: R31 – R30
2. Non-critical registers
   1. register file: R29 – R25, R23 – R0
   2. extended addressing registers: RAMPD/X/Y/Z, EIND
   3. status register: SREG (except interrupt flag)

Return values:

  false | No register fault detected.
  true | Register fault detected.

Note:
  Interrupts must be disabled during this test.

Definition at line 80 of file classb_cpu_gcc.c.

References CLASSB_ERROR_CRIT, CLASSB_ERROR_HANDLER_REGISTERS, and CLASSB_ERROR_NON_CRIT.

Referenced by ISR().

Here is the caller graph for this function: