I’m trying to use the interruption and I would liko to know how do it using the edge. That’s my code:
struct sigevent event;
void* int_thread (void *arg);
const struct sigevent * isr_handler (void *arg, int id);
int var=0;
int main(int argc, char *argv[]) {
event.sigev_notify = SIGEV_INTR;
while(1){
pthread_create (NULL, NULL, int_thread, NULL);
delay(1000);
}
}
const struct sigevent * isr_handler (void *arg, int id) {
var ++;
return (&event);
}
void* int_thread (void *arg)
{
int errvalue, erroWait, valor;
ThreadCtl (_NTO_TCTL_IO, NULL); // enable I/O privilege
InterruptAttach(0xE,isr_handler,NULL,0,_NTO_INTR_FLAGS_TRK_MSK);
//InterruptAttachEvent(0xE,&event,_NTO_INTR_FLAGS_TRK_MSK);
//errvalue = errno;
//printf(“Erro: %s\n”, strerror(errvalue));
while (1)
{
InterruptWait (NULL, NULL);
erroWait=errno;
printf("erroWait=%s %d\n", strerror(erroWait),var);
}
}
I’m doing the interruption on IRQ15, but when I run this code, it interrupts alone, without doing anything.
Thanks.
(Sorry about my english.)