The preprocessor has a number of pre-defined macros. All have names starting and ending with two underscores (__). To avoid conflicts, user-defined macros should not use this naming convention.

Pre-defined macros are either built-in, or they are set by the #pragma directive, as indicated in the table.

Name

type

Set by

Description

__AVRASM_VERSION__

Integer

Built-in

Assembler version, encoded as (1000*major + minor)

__CORE_VERSION__

String

#pragma

AVR core version.

__DATE__

String

built-in

Build date. Format: "Jun 28 2004", see -FDformat.

__TIME__

String

built-in

Build time. Format: "HH:MM:SS". see -FDformat

__CENTURY__

Integer

built-in

Build time century (typically 20)

__YEAR__

Integer

built-in

Build time year, less century (0-99)

__MONTH__

Integer

built-in

Build time month (1-12)

__DAY__

Integer

built-in

Build time day (1-31)

__HOUR__

Integer

built-in

Build time hour (0-23)

__MINUTE__

Integer

built-in

Build time minute (0-59)

__SECOND__

Integer

built-in

Build time second (0-59)

__FILE__

String

built-in

Source file name.

__LINE__

Integer

built-in

Current line number in source file.

__PART_NAME__

String

#pragma

AVR part name.

__partname__

Integer

#pragma

partnamecorresponds to the value of __PART_NAME__. Example: #ifdef __ATmega8__

__CORE_coreversion__

Integer

#pragma

coreversioncorresponds to the value of __CORE_VERSION__. Example: #ifdef __CORE_V2__