Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » MSPGCC
  • » [Mspgcc-users] compiler-independent ISR declarations [RSS Feed]

#1 Oct. 17, 2005 22:30:39

n.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Mspgcc-users] compiler-independent ISR declarations


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.hI 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

Offline

#2 Oct. 18, 2005 14:35:27

Steve U.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Mspgcc-users] compiler-independent ISR declarations


Hi Rolf,Excellent idea. However your version seems incomplete. The attached filetries to work with MSPGCC, Quadravox, IAR 1-3, Rowley, and CCE. I triedit briefly (not thoroughly) with MSPGCC, Quadravox, IAR 3.x, and CCE. Itseems to work OK.I'd like to get this tested and into CVS when it has been reviewed alittle. I need to write code that is built with multiple compilers, andthe ISR definitions have been annoying me for a while. Your postingprompted me to finally address the issue.Regards,
Steve

nobo***@*eb.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.hI 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



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more.http://solutions.newsforge.com/ibmarch.tmpl_______________________________________________
Mspgcc-users mailing list
Mspgcc-us***@*ists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/mspgcc-users/* 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 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 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(void)
#else
/* Assume this is the Code Composer Essentials compiler. They don't
seem to define anything we can check for */
#define ISR(a,b) __interrupt void b(void); \
a ## _ISR(b) \
__interrupt void b(void)
#endif

Offline

#3 Oct. 18, 2005 15:17:56

Recoskie, C.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Mspgcc-users] compiler-independent ISR declarations


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, Torontohttp://eclipse.org/cdt> -----Original Message-----
> From: mspgcc-users-ad***@*ists.sourceforge.net On Behalf Of Steve Underwood
> Sent: Tuesday, October 18, 2005 9:35 AM
> To: mspgcc-us***@*ists.sourceforge.net
> Subject: Re: 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***@*eb.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
> >
> >
> >
> >-------------------------------------------------------
> >This SF.Net email is sponsored by:
> >Power Architecture Resource Center: Free content, downloads,
discussions,
> >and more.http://solutions.newsforge.com/ibmarch.tmpl> >_______________________________________________
> >Mspgcc-users mailing list
> >Mspgcc-us***@*ists.sourceforge.net
> >https://lists.sourceforge.net/lists/listinfo/mspgcc-users> >
> >
> >

Offline

#4 Oct. 18, 2005 18:28:10

n.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Mspgcc-users] compiler-independent ISR declarations


Hi Steve,

ok. I used my version with the current rowley compiler (crossstudio)
and mspgcc without problems.
I have not tested with other compilers.

Regards,

Rolf
------------------------
true-random.com/freelancing


mspgcc-us***@*ists.sourceforge.net schrieb am 18.10.05 15:37:05:
>
> 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***@*eb.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
> >
> >
> >
> >-------------------------------------------------------
> >This SF.Net email is sponsored by:
> >Power Architecture Resource Center: Free content, downloads, discussions,
> >and more.http://solutions.newsforge.com/ibmarch.tmpl> >_______________________________________________
> >Mspgcc-users mailing list
> >Mspgcc-us***@*ists.sourceforge.net
> >https://lists.sourceforge.net/lists/listinfo/mspgcc-users> >
> >
> >
>
>

Offline

#5 Oct. 20, 2005 17:57:07

Kevin S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Mspgcc-users] compiler-independent ISR declarations


Could you please tell me where exactly in CVS I can find isr_compat.h? I've
been having trouble using command line cvs the last few days, so I guess I'll
have to use the web interface.

I try this:

cvs -z3 -d:pserver:anonym***@*vs.sourceforge.net:/cvsroot/mspgcc co -P gcc

and get this:

cvs : recv() from server cvs.sourceforge.net: EOF

This happens for several of the modules (eg, python and jtag). After many
retries, I was able to finally get python and jtag, but so far no luck with
gcc (I'm assuming this is where isr_compat.h is?).

Has anyone else experienced this problem with CVS?

Thanks,
Kevin


On Thursday 20 October 2005 9:34 am, Steve Underwood wrote:
> This code now in CVS as isr_compat.h, and seems a useful file for people
> like me writing code which must be portable. I should have done
> something about this ages ago.
>
> Regards,
> Steve

Offline

#6 Oct. 20, 2005 18:03:52

Steve U.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Mspgcc-users] compiler-independent ISR declarations


It is amongst the include files in msp430-libc

Steve


Kevin Schmeichel wrote:Could you please tell me where exactly in CVS I can find isr_compat.h? I'vebeen having trouble using command line cvs the last few days, so I guess I'llhave to use the web interface.I try this:

cvs -z3 -d:pserver:anonym***@*vs.sourceforge.net:/cvsroot/mspgcc co -P gcc

and get this:

cvs : recv() from server cvs.sourceforge.net: EOFThis happens for several of the modules (eg, python and jtag). After manyretries, I was able to finally get python and jtag, but so far no luck withgcc (I'm assuming this is where isr_compat.h is?).Has anyone else experienced this problem with CVS?

Thanks,
Kevin


On Thursday 20 October 2005 9:34 am, Steve Underwood wrote:This code now in CVS as isr_compat.h, and seems a useful file for people
like me writing code which must be portable. I should have done
something about this ages ago.

Regards,
Steve

Offline

#7 Nov. 1, 2005 21:15:57

Kevin S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Mspgcc-users] compiler-independent ISR declarations


I've just got around to trying isr_compat.h with CCE and have found that
__TI_COMPILER_VERSION is *not* defined for my setup. I get the error
"Compiler not recognized".

Chris, any idea why this wouldn't be defined? I can give you the details on
my CCE setup, but as far as I know it's the latest. If I manually define
__TI_COMPILER_VERSION, the code compiles fine, but it'd be nice if I didn't
have to do this for every project.

Has anyone else had this problem?

Thanks,
Kevin

On Tuesday 18 October 2005 7:49 am, Steve Underwood wrote:
> 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.

Offline

#8 Nov. 1, 2005 21:52:48

Recoskie, C.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Mspgcc-users] compiler-independent ISR declarations


Ooops...

According to the guy that wrote the compiler, that should be
__TI_COMPILER_VERSION__

I missed the trailing underscores. Looks like this means I have a bug in the
macro definitions internal to CCE as well, so if you try to use the macro, the
indexer is likely going to complain about phantom syntax errors.

Sorry about the mixup.

___________________________________________

Chris Recoskie
Software Designer
Texas Instruments, Torontohttp://eclipse.org/cdt> -----Original Message-----
> From: mspgcc-users-ad***@*ists.sourceforge.net On Behalf Of Kevin Schmeichel
> Sent: Tuesday, November 01, 2005 4:16 PM
> To: mspgcc-us***@*ists.sourceforge.net
> Subject: Re: compiler-independent ISR declarations
>
>
> I've just got around to trying isr_compat.h with CCE and have found that
> __TI_COMPILER_VERSION is *not* defined for my setup. I get the error
> "Compiler not recognized".
>
> Chris, any idea why this wouldn't be defined? I can give you the
> details on
> my CCE setup, but as far as I know it's the latest. If I manually define
> __TI_COMPILER_VERSION, the code compiles fine, but it'd be nice if I
> didn't
> have to do this for every project.
>
> Has anyone else had this problem?
>
> Thanks,
> Kevin
>
> On Tuesday 18 October 2005 7:49 am, Steve Underwood wrote:
> > 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.
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by:
> Tame your development challenges with Apache's Geronimo App Server.
> Download
> it for free - -and be entered to win a 42" plasma tv or your very own
> Sony(tm)PSP. Click here to play:http://sourceforge.net/geronimo.php> _______________________________________________
> Mspgcc-users mailing list
> Mspgcc-users@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Offline

#9 Nov. 1, 2005 22:04:02

Kevin S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Mspgcc-users] compiler-independent ISR declarations


Thanks, Chris. I just made the change to my local copy of isr_compat.h and
verified that it does compile under CCE, so hopefully Steve can get the
change into CVS.

Kevin

On Tuesday 01 November 2005 1:52 pm, Recoskie, Chris wrote:
> Ooops...
>
> According to the guy that wrote the compiler, that should be
> __TI_COMPILER_VERSION__
>
> I missed the trailing underscores.  Looks like this means I have a bug in
> the macro definitions internal to CCE as well, so if you try to use the
> macro, the indexer is likely going to complain about phantom syntax errors.
>
> Sorry about the mixup.
>
> ___________________________________________
>  
> Chris Recoskie

Offline

  • Root
  • » MSPGCC
  • » [Mspgcc-users] compiler-independent ISR declarations [RSS Feed]

Board footer

Moderator control

Enjoy the 20th of November
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support