Hi Chris,

Thanks. The attached version makes use of __TI_COMPILER_VERSION.

Regards,
Steve

Recoskie, Chris wrote:

I looked at your header file and noticed you had a hard time finding a
macro to use to identify CCE.  You can use the macro
__TI_COMPILER_VERSION to detect the TI code generation tools in general.

___________________________________________

Chris Recoskie
Software Designer
Texas Instruments, Toronto
http://eclipse.org/cdt


-----Original Message-----
From: mspgcc-users-ad...@lists.sourceforge.net [mailto:mspgcc-users-
ad...@lists.sourceforge.net] On Behalf Of Steve Underwood
Sent: Tuesday, October 18, 2005 9:35 AM
To: mspgcc-users@lists.sourceforge.net
Subject: Re: [Mspgcc-users] compiler-independent ISR declarations

Hi Rolf,

Excellent idea. However your version seems incomplete. The attached
file
tries to work with MSPGCC, Quadravox, IAR 1-3, Rowley, and CCE. I
tried
it briefly (not thoroughly) with MSPGCC, Quadravox, IAR 3.x, and CCE.
It
seems to work OK.

I'd like to get this tested and into CVS when it has been reviewed a
little. I need to write code that is built with multiple compilers,
and
the ISR definitions have been annoying me for a while. Your posting
prompted me to finally address the issue.

Regards,
Steve

nobo...@web.de wrote:

Hi,

i made macros for compiler-independent ISR declarations to have a C
code
which can be compiled with mspgcc, IAR V1 and crossworks:

http://random.linux-site.net/files/unsorted/mspgcc/compiler.h

I think it would be a good idea to add it to mspgcc because it would
force TI
to do the C examples compiler independent.
I used the current version with mspgcc and crossworks.

Regards,

Rolf
/* Cross compiler interrupt compatibility definitions */
/* This code currently allows for:
        MSPGCC - the GNU tools for the MSP430
        Quadravox AQ430
        IAR Version 1 (old syntax)
        IAR Versions 2 and 3 (new syntax)
        Rowley Crossworks
        Code Composer Studio

   These macros allow us to define interrupt routines for all
   compilers with a common syntax:
   
    ISR(<interrupt>, <routine name>)
    {
    }
   
   e.g.
   
    ISR(ADC12, adc_service_routine)
    {
        ADC12CTL0 &= ~ENC;
        ADC12CTL0 |= ENC;
    }
*/

#if defined(__GNUC__)  &&  defined(__MSP430__)
    /* This is the MSPGCC compiler */
#define ISR(a,b) interrupt(a ## _VECTOR) b(void)
#elif defined(__AQCOMPILER__)
    /* This is the Quadravox compiler */
#define ISR(a,b) void _INTERRUPT[a ## _VECTOR] b(void)
#elif defined(__IAR_SYSTEMS_ICC__)  &&  (((__TID__ >> 8) & 0x7f) == 43)  &&  (__VER__ < 200)
    /* This is V1.xx of the IAR compiler. */
#define ISR(a,b) interrupt[a ## _VECTOR] void b(void)
#elif defined(__IAR_SYSTEMS_ICC__)  &&  (((__TID__ >> 8) & 0x7f) == 43)  &&  (__VER__ < 400)
    /* This is V2.xx or V3.xx of the IAR compiler. */
#define ISR(a,b) #pragma vector = a ## _VECTOR \
__interrupt void b(void)
#elif defined(__CROSSWORKS_MSP430)
    /* This is the Rowley Crossworks compiler */
#define ISR(a,b) void b __interrupt[a ## _VECTOR](void)
#elif defined(__TI_COMPILER_VERSION)
    /* This is the Code Composer Essentials compiler. */
#define ISR(a,b) __interrupt void b(void); \
a ## _ISR(b) \
__interrupt void b(void)
#else
    #error Compiler not recognised.
#endif

Reply via email to