Forum Discussion
Altera_Forum
Honored Contributor
13 years agoBasic NIOS II interrupt.
I am getting the warning.
--- Quote Start --- warning: implicit declaration of function 'alt_irq_register' --- Quote End --- Call in code is alt_irq_register(CODEC_SIMPLE_MASTER_2_0_IRQ_INTERRUPT_CONTROLLER_ID, (void *) NULL, codec_isr); I have also included <alt_irq.h> Can I ignore this warning?14 Replies
- Altera_Forum
Honored Contributor
Have you implemented the internal irq controller or the VIC?
If the latter, you must use the enhanced interrupt APIs: alt_ic_isr_register - Altera_Forum
Honored Contributor
--- Quote Start --- Have you implemented the internal irq controller or the VIC? If the latter, you must use the enhanced interrupt APIs: alt_ic_isr_register --- Quote End --- The internal interrupt controller. - Altera_Forum
Honored Contributor
Try # include "alt_legacy_irq.h"
although this should be automatically included by alt_irq.h whenever the enhanced irq APIs are not enabled, namely if you don't use the external irq controller. - Altera_Forum
Honored Contributor
I am now getting
warning: alt_legacy_irq.h: No such file or directory - Altera_Forum
Honored Contributor
--- Quote Start --- I am now getting warning: alt_legacy_irq.h: No such file or directory --- Quote End --- Ok.... I included # include "priv/alt_legacy_irq.h" Now I get warning..... "passing argument 3 of 'alt_irq_register' from incompatible pointer type" Prototype for alt_irq_resgister in priv/alt_legacy_irq.h is extern int alt_irq_register (alt_u32 id, void* context, alt_isr_func handler); As I said my file calls alt_irq_register(CODEC_SIMPLE_MASTER_2_0_IRQ_INTERRUPT_CONTROLLER_ID, NULL, codec_isr); codec_isr is handler and is defined as static void codec_isr(void * context, alt_u32 id) { .... ..... ...... } - Altera_Forum
Honored Contributor
Search the headers for the definition of alt_isr_func, probably doesn't quite match the function you supplied.
Or my 'trick', add -E to the gcc command file and then open the .o file in a text editor and search through the pre-processed output. (Might be difficult from the IDE) - Altera_Forum
Honored Contributor
--- Quote Start --- Search the headers for the definition of alt_isr_func, probably doesn't quite match the function you supplied. Or my 'trick', add -E to the gcc command file and then open the .o file in a text editor and search through the pre-processed output. (Might be difficult from the IDE) --- Quote End --- From alt_irq.h all I can see is this. # ifdef ALT_ENHANCED_INTERRUPT_API_PRESENT typedef void (*alt_isr_func)(void* isr_context); # else typedef void (*alt_isr_func)(void* isr_context, alt_u32 id); # endif Hmmm... - Altera_Forum
Honored Contributor
I'd try removing the u32 parameter and see if the warning goes away.
If that is what the compiler is complaining about you need to sort out whether you should be using the enhanced interrupt api or not. Eveything will need to be consistent. - Altera_Forum
Honored Contributor
I included the line
# undef ALT_ENHANCED_INTERRUPT_API_PRESENT In my main c file. The warning went away. I am rusty on this. Probably a better way of doing this. - Altera_Forum
Honored Contributor
The warning might have gone away, but that doesn't mean the actual call (to your ISR) will provide the extra parameter.
I'd guess there is some BSP config option that sets it.