0% found this document useful (0 votes)
18 views

C Reference Manual - October 2005.52

This document provides reference information about the __DEVICE__ and #ERROR pre-processor directives in a C compiler: __DEVICE__ defines a pre-processor identifier with the base number of the current device based on the #device directive. For example, the PIC16C622 has a base number of 622. #ERROR forces the compiler to generate an error at the location in the code. It can include text to display the error or expand macros to show their values. It is used to alert the user to invalid compile-time situations.

Uploaded by

diegoifg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

C Reference Manual - October 2005.52

This document provides reference information about the __DEVICE__ and #ERROR pre-processor directives in a C compiler: __DEVICE__ defines a pre-processor identifier with the base number of the current device based on the #device directive. For example, the PIC16C622 has a base number of 622. #ERROR forces the compiler to generate an error at the location in the code. It can include text to display the error or expand macros to show their values. It is used to alert the user to invalid compile-time situations.

Uploaded by

diegoifg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

C Compiler Reference Manual

__DEVICE__
Syntax:

__device __

Elements:

None

Purpose:

This pre-processor identifier is defined by the compiler with


the base number of the current device (from a #device).
The base number is usually the number after the C in the
part number. For example the PIC16C622 has a base
number of 622.

Examples:

#if __device__==71
SETUP_ADC_PORTS( ALL_DIGITAL );
#endif

Example Files:

None

Also See:

#device

#ERROR
Syntax:

#error text

Elements:

text is optional and may be any text

Purpose:

Forces the compiler to generate an error at the location this


directive appears in the file. The text may include macros
that will be expanded for the display. This may be used to
see the macro expansion. The command may also be used
to alert the user to an invalid compile time situation.

Examples:

#if BUFFER_SIZE>16
#error Buffer size is too large
#endif
#error
Macro test: min(x,y)

Example Files:

ex_psp.c

Also See:

None

40

You might also like