Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - Interruption: Page 1 of 4 (4 Items)
   
Interruption  
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.)