Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
13 years ago

Basic 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's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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:
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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.