Arm Community
Site
Search
User
Site
Search
User
Support forums
Arm Development Studio forum
How handle Cortex-M0 Interrupts on IAR using C++?
Locked
Locked
Replies
3 replies
Subscribers
119 subscribers
Views
5899 views
Users
0 members are here
Options
Share
More actions
Related
How was your experience today?
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion
How handle Cortex-M0 Interrupts on IAR using C++?
Andre Pereira
over 12 years ago
Note: This was originally posted on 30th August 2011 at
http://forums.arm.com
[font=Times][size=2][font=arial, verdana, tahoma, sans-serif][size=2]Hello everybody,
I'm using IAR 6.21 compiler and a LPC11C14 IAR's dev board, doing my firsts test with C++.[/size][/font]
Also I'm simulating UART interrupts in the C-SPY simulator, all working great on C, so the problem is not the macros or whatever.
I search on the web how to handle interrupts in C++, and found that:
http://www.eetimes.com/design/embedded/4023817/Interrupts-in-C-
So I did this on my code:
in uart.h:
class uart
{
...
public:
static void UART0_IRQHandler( void );
}
in uart.c:
void uart::UART0_IRQHandler( void );
{
// breakpoint reading the UART receive register
}
And the vector is defined correctly in cstartup_m.s and in the cstartup_m.c (I've tested with either, one per time obviously)
the vector worked fine in C, so it's not the problem.
The problem is my static member is not even linked, the linker uses the default function provided in the vector definition source code.
I tried to figure out what I'm doing wrong and made some other tests also, but no way to establish a connection between the uart interrupt vector and mu static member function.
It works if I "mix" C with C++ using "extern C" definitions, but I believe that should be a "correct" way of doing this.
What I'm doing wrong?
Is this the best way of deal with interrupts in C++?
Thanks in advance buddies.
André Rairan.[/size][/font]
0
Quote