# avr_compiler.h File Reference

This file implements some macros that makes the IAR C-compiler and avr-gcc work with the same code base for the AVR architecture. More...

`#include <stdint.h>`
`#include <stdbool.h>`
`#include <stdlib.h>`
Include dependency graph for avr_compiler.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Defines
#define | AVR_ENTER_CRITICAL_REGION()
#define | AVR_LEAVE_CRITICAL_REGION() SREG = saved_sreg;

## Detailed Description

This file implements some macros that makes the IAR C-compiler and avr-gcc work with the same code base for the AVR architecture.

Application note:
  AVR1010: Minimizing the power consumption of XMEGA devices

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@atmel.com

Revision
  2770

Date
  2009-09-11 16:55:22 +0800 (Fri, 11 Sep 2009)

Definition in file avr_compiler.h.

## Define Documentation

#define AVR_ENTER_CRITICAL_REGION | ( |  | ) |

Value:

    uint8_t volatile saved_sreg = SREG; \
                                         cli();

This macro will protect the following code from interrupts.

Definition at line 59 of file avr_compiler.h.

Referenced by CCPWrite().

#define AVR_LEAVE_CRITICAL_REGION | ( |  | ) | SREG = saved_sreg;

This macro must always be used in conjunction with ENTER_CRITICAL_REGION so that interrupts are enabled again.

Definition at line 64 of file avr_compiler.h.

Referenced by CCPWrite().