Forum Discussion
Altera_Forum
Honored Contributor
12 years agoYea, I ran into the same issue using the older style irq register stuff. I have a block of code in QSYS that feeds out an interrupt to the NIOS. Below is an example of old vs enhanced IRQ for you all to see. All of the variables in UPPERCASE were taken from the system.h file. You can also look at a sample in your c:\altera folder in the NIOS directory. look up count_binary.
C:\altera\13.0sp1\nios2eds\examples\software\count_binary OLD IRQ API EXAMPLE ///////// static void isr_PUSH_BUTTONS(void *context) { printf("PB IRQ hit "); } main { alt_irq_register(PUSH_BUTTONS_IRQ, 0 , isr_PUSH_BUTTONS); } ///////// ENHANCED IRQ API ///////// static void isr_PUSH_BUTTONS(void *context) { printf("PB IRQ hit "); } main { alt_ic_isr_register(PUSH_BUTTONS_IRQ_INTERRUPT_CONTROLLER_ID, PUSH_BUTTONS_IRQ, isr_PUSH_BUTTONS, 0, 0); alt_ic_irq_enable(PUSH_BUTTONS_IRQ_INTERRUPT_CONTROLLER_ID, PUSH_BUTTONS_IRQ); while(1){} } /////////