Hi, I've some trouble with NIOS II PIO interrupts and need some help. The pio port is configured as follows: Width= 2 bits Both input and output ports (not tri-state) Synchronously capture: Rising Edge IRQ= edge sensitiv
I dont want to use HAL to keep the code size small, that's why I use alt_main.
static void AudioCodecInISR(void* context, alt_u32 id) { volatile int inChL = 0; inChL = IORD_ALTERA_AVALON_PIO_EDGE_CAP(CodecIRQRegBase); /* Reset the Button's edge capture register. */ IOWR_ALTERA_AVALON_PIO_EDGE_CAP(CodecIRQRegBase, 0); }
int main (void) __attribute__ ((weak, alias ("alt_main"))); int alt_main (void) { void * context; alt_irq_init(ALT_IRQ_BASE); IOWR_ALTERA_AVALON_PIO_IRQ_MASK(CodecIRQRegBase, 0x3); /* Reset the Button's edge capture register. */ IOWR_ALTERA_AVALON_PIO_EDGE_CAP(CodecIRQRegBase, 0x0); /* Register the interrupt handler. */ alt_irq_register( CodecIRQRegBase, context, AudioCodecInISR );
while (1) { } return 0; }
Does anybody has any clue where the bug is?
Thanks, Horst