--- Quote Start ---
The second function parameter must rather be the actual irq you want to be enabled, not VIC_IRQ.
Moreover, did you succeed in registering the interrupt? I mean, did you already call lt_ic_isr_register() without errors?
--- Quote End ---
sorry Cris i didn't get you i mean "actual irq" mean what..?
in my understanding VIC will take all the Interrupt and manage them based on priority ...correct me if i am wrong
but before that i need to enable alt_ic_irq_enable();
* Yes ! i already call lt_ic_isr_register() without errors.
below is the code i am using for understanding
enhance vector interrupt # include <stdio.h># include "sys/alt_irq.h"# include "system.h"# include "altera_avalon_pio_regs.h"
volatile int edge_capture;
void handle_load_data_interrupts(void* context, alt_u32 id)
{
volatile int* edge_capture_ptr = (volatile int*) context;
IOWR_ALTERA_AVALON_PIO_IRQ_MASK(LOAD_DATA_BASE, 0x1 );
*edge_capture_ptr = IORD_ALTERA_AVALON_PIO_EDGE_CAP(LOAD_DATA_BASE);
IOWR_ALTERA_AVALON_PIO_EDGE_CAP(LOAD_DATA_BASE, 0x1);
IORD_ALTERA_AVALON_PIO_EDGE_CAP(LOAD_DATA_BASE);
}
void init_load_pio()
{
void* edge_capture_ptr = (void*) &edge_capture;
IOWR_ALTERA_AVALON_PIO_IRQ_MASK(LOAD_DATA_BASE, 0x1);
IOWR_ALTERA_AVALON_PIO_EDGE_CAP(LOAD_DATA_BASE, 0x1);
alt_ic_isr_register(LOAD_DATA_IRQ_INTERRUPT_CONTROLLER_ID, LOAD_DATA_IRQ, handle_load_data_interrupts, edge_capture_ptr, 0x0);
}
int main()
{
int rc;
rc = alt_ic_irq_enable(VIC_INTERRUPT_CONTROLLER_ID,VIC_IRQ);
if(rc<0) printf("\n\tEnhance Interrupt not enabled, Return value = %d",rc);
else printf("\n\tEnhnace interrupt enabled, Return value = %d",rc);
printf("\n\tInitillize the Enhanced Interrupt..");
init_load_pio();
return 0;
}