Altera_Forum
Honored Contributor
15 years agoProblem in registering ISR (C++)
HI.
I'm doing my thesis on a DE2 board. I'm using a NIOS II processor. I've been writing all my source code in C. That way, it worked perfectly. I had to ****ch to C++ for a few reasons (which I'm not gonna explain here). The thing is: I have some problems to register an ISR. This is the "old" code (which works in C):void simpler_isr()
{
for(j=0; j<3; j++)
{
store_array = IORD(FULL_CLASIFIER_0_BASE, 0x00);
}
i++;
flag++;
} and this is the part where I register the isr: alt_ic_isr_register(FULL_CLASIFIER_0_IRQ_INTERRUPT_CONTROLLER_ID,
FULL_CLASIFIER_0_IRQ,
simpler_isr,
NULL,
0x0);
When I tried to compile in C++, I got this error mesage: initializing argument 3 of `int alt_ic_isr_register(alt_u32, alt_u32, void (*)(void*), void*, void*)' invalid conversion from `void (*)()' to `void (*)(void*)' So, I changed the ISR this way: void simpler_isr(void*)
{
for(j=0; j<3; j++)
{
store_array = IORD(FULL_CLASIFIER_0_BASE, 0x00);
}
i++;
flag++;
} Now, I get this message: Undefined reference to "main" I don't know what I'm missing. THANKS.