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.

Extended keywords__interruptSyntaxDescriptionExampleFollows the generic syntax rules for type attributes that can be used on functions, seeType attributes, page 189.The __interrupt keyword specifies interrupt functions. To specify one or severalinterrupt vectors, use the #pragma vector directive. The range of the interrupt vectorsdepends on the device used. It is possible to define an interrupt function without a vector,but then the compiler will not generate an entry in the interrupt vector table.An interrupt function must have a void return type and cannot have any parameters.The header file iodevice.h, where device corresponds to the selected device,contains predefined names for the existing interrupt vectors.#pragma vector=0x14__interrupt void my_interrupt_handler(void);See also Interrupt functions, page 23, vector, page 214, INTVEC, page 248.__intrinsicDescriptionThe __intrinsic keyword is reserved for compiler internal use only.__monitorSyntaxDescriptionExampleSee alsoFollows the generic syntax rules for type attributes that can be used on functions, seeType attributes, page 189.The __monitor keyword causes interrupts to be disabled during execution of thefunction. This allows atomic operations to be performed, such as operations onsemaphores that control access to resources by multiple processes. A function declaredwith the __monitor keyword is equivalent to any other function in all other respects.__monitor int get_lock(void);Monitor functions, page 26. Read also about the intrinsic functions __disable_interrupt,page 220, __enable_interrupt, page 220, __get_interrupt_state, page 221, and__set_interrupt_state, page 223.Part 2. <strong>Compiler</strong> <strong>reference</strong>195

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

Saved successfully!

Ooh no, something went wrong!