- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you implemented the internal irq controller or the VIC?
If the latter, you must use the enhanced interrupt APIs: alt_ic_isr_register- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- 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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am now getting
warning: alt_legacy_irq.h: No such file or directory- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- 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) { .... ..... ...... }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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)- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- 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...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can't see any BSP config however this is where I am at.
I got the thing to build again using ALT_ENHANCED_INTERRUPT_API_PRESENT And using Enhanced Interrupts. I set up the interrupt in code by calling alt_ic_isr_register (CODEC_SIMPLE_MASTER_2_0_IRQ_INTERRUPT_CONTROLLER_ID, CODEC_SIMPLE_MASTER_2_0_IRQ, codec_isr, NULL, 0x0); My interrupt service routine is. static void codec_isr (void *context) { } This builds fine however the processor seems to hang when the interrupt is asserted. I did an enhanced interrupt based PIO based project and I can get into the interrupt here (to check if my setup was correct). So my custom peripheral's interrupt seems to hang the NIOS II processor. (The main loop is no longer running). Weird. Any ideas?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Found the problem.
Me and my software bugs. I was setting up the DMA with a wrong address and probably overwriting a critical area of memory. Ooops.... :oops:- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
only you include# undef ALT_ENHANCED_INTERRUPT_API_PRESENT and dissapear the warning???
I've incluided this line, but the warning continues, and the interrupt doens't work Help me in this problem- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
By default ALT_ENHANCED_INTERRUPT_API_PRESENT is defined. Therefore you need to set up with the interrupt prototypes for these given in the appropriate header file.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page