2009/9/26 Piotr Romaniuk <[email protected]>

> Hello,
>
> I cannot compile __bic_SR_register_on_exit() using mspgcc version 3.2.3:
> My source file:
>
> #include <iomacros.h>
> #define USCI_A0_VECTOR              114
> #define OSCOFF (1<<5)
> extern "C" interrupt( USCI_A0_VECTOR) isr_func(void)
> {
>                __bic_SR_register_on_exit( OSCOFF );
> }
>

Per Steve Underwood's MSPGCC manual,  you have to #include <signal.h> in the
interrupt service code modules (1) . Also, extern "C" is not necessary for
compiling C, and I believe is not even alowed in C code: it prevents
mangling of C++ externals so it's only needed for C++ code (i.e.
.cpp/.C/.cxx files). With those two changes, your code compiles. with
warnings about __FUNCTION__ being deprecated, and an invalid Interrupt
vector being assigned to your ISR.

I understand that the current GCC replaces  __FUNCTION__ with __func__
so the iomacros.h file should be patched accordingly. I am not sure about
the ISR vector number: the warning is about vector 0x10052 which isn't even
mentioned in the file. Perhaps someone familiar with writing ISRs for MSPGCC
can explain what's going on.


(1) Page 18,
http://www.eecs.harvard.edu/~konrad/projects/motetrack/mspgcc-manual-20031127.pdf

Reply via email to