13.07.2015 Views

TASKING VX-toolset for ARM User Guide

TASKING VX-toolset for ARM User Guide

TASKING VX-toolset for ARM User Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

<strong>TASKING</strong> <strong>VX</strong>-<strong>toolset</strong> <strong>for</strong> <strong>ARM</strong> <strong>User</strong> <strong>Guide</strong>Examplevoid __interrupt_irq serial_receive( void ){...}Vector symbolsWhen you use one or more of these __interrupt_xxx function qualifiers, the compiler generates acorresponding vector symbol to designate the start of an exception handler function. The linker uses thissymbol to automatically generate the exception vector.Function type qualifier__interrupt_und__interrupt_svc__interrupt_iabt__interrupt_dabt__interrupt_irq__interrupt_fiq__interrupt(n)Vector symbol_vector_1_vector_2_vector_3_vector_4_vector_6_vector_7_vector_nVector symbol M-profile-_vector_11----_vector_nNote that the reset handler is designated by the symbol _START instead of _vector_0 (_vector_1 <strong>for</strong>M-profile architectures).You can prevent the compiler from generating the _vector_n symbol by specifying the function qualifier__novector.This can be necessary if you have more than one interrupt handler <strong>for</strong> the same exception,<strong>for</strong> example <strong>for</strong> different IRQ's or <strong>for</strong> different run-time phases of your application.Without the __novectorfunction qualifier the compiler generates the _vector_n symbol multiple times, which results in a linkerror.void __interrupt_irq __novector another_handler( void ){... // used __novector to prevent multiple _vector_6 symbols}Enable interrupts in exception handlers (not <strong>for</strong> M-profile architectures)Normally interrupts are disabled when an exception handler is entered. With the function qualifier__nesting_enabled you can <strong>for</strong>ce that the link register (LR) is saved and that interrupts are enabled.For example:void __interrupt_svc __nesting_enabled svc( int n ){if ( n == 2 ){__svc(3);}26

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

Saved successfully!

Ooh no, something went wrong!