11.07.2015 Views

MSP430 IAR C/C++ Compiler reference guide - Rice University

MSP430 IAR C/C++ Compiler reference guide - Rice University

MSP430 IAR C/C++ Compiler reference guide - Rice University

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Pragma directiveslocationSyntax#pragma location={address|NAME}ParametersaddressNAMEThe absolute address of the global or static variable for which youwant an absolute location.A user-defined segment name; cannot be a segment namepredefined for use by the compiler and linker.DescriptionExampleUse this pragma directive to specify the location—the absolute address—of the globalor static variable whose declaration follows the pragma directive. The variable must bedeclared either __no_init or const. Alternatively, the directive can take a stringspecifying a segment for placing either a variable or a function whose declarationfollows the pragma directive.#pragma location=0x22E__no_init volatile char PORT1; /* PORT1 is located at address0x22E */#pragma location="foo"char PORT1; /* PORT1 is located in segment foo *//* A better way is to use a corresponding mechanism */#define FLASH _Pragma("location=\"FLASH\"")...FLASH int i; /* i is placed in the FLASH segment */See also Controlling data and function placement in memory, page 116.messageSyntax#pragma message(message)ParametersmessageThe message that you want to direct to stdout.DescriptionExample:Use this pragma directive to make the compiler print a message to stdout when the fileis compiled.#ifdef TESTING#pragma message("Testing")#endifPart 2. <strong>Compiler</strong> <strong>reference</strong>207

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!