HI All,
I need to use an external interrupt for a new project with the 9P module.
EIRQ3 on GPIO101 seems to be reasonably free(only used on dev board for I2C IO) and does not conflict with other signals.
I therefore started with the sample application “Wakeup Interrupt Sample” and have tried to modify it to use EIRQ3. This used the wakeup button on the dev board and shows how to use EIRQ2.
I have revised the interrupt routine, hopefully to clear EiRQ3 as follows
static int pdirq3Isr(void *context)
{
static int level = 1;
(void) context;
/* clear the interrupt */
narm_write_reg (NA_SCM_EICR_REG, NA_SCM_EICR_3_ADDRESS, clr, 1);
narm_write_reg (NA_SCM_EICR_REG, NA_SCM_EICR_3_ADDRESS, clr, 0);
naGpioSetOutputValue(GPIO_USER_LED1, level++);
level %= 2;
naGpioSetOutputValue(GPIO_USER_LED2, level);
return 0;
}
Within the GPIO configuration function I have set up the GPIO as an iinterrupt:
ret = naGpioSetInterrupt(101, 1, 1);
if (ret != EXTERNAL3_INTERRUPT)
{
printf("naGpioSetInterrupt(101) returns %d.
", ret);
return ret;
}
I then set up the ISR with:
ret = naIsrInstall(EXTERNAL3_INTERRUPT, pdirq3Isr, NULL);
if (ret != 0)
{
printf ("naIsrInstall failure[%d]
", ret);
return ret;
}
However when I call naIsrInstall the system seems to crash.
Can anyone offer any advice where I am going wrong
Regards
Roy