Jump to ID:
QNX Operating System

Project Home

Documents

Discussions

Wiki

Project Info
Forum Topic - ISR not getting invoked: Page 1 of 11 (11 Items)
   
 
 
ISR not getting invoked  
Hi,

I am using the mpc85xx Board and registered the interrupt pin 0x8 along with process.

MY interrupt handler is not getting invoked.I have pasted my code.
Please let me know incase of any mistakes..


/* OS specific Header files */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <errno.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <net/if.h>
#include <string.h>
#include <sys/neutrino.h>
#include <sys/neutrino.h>
#include <sys/types.h>

void *int_thread (void *arg);
const struct sigevent *isr_handler (void *arg, int id);

struct sigevent event;

int main ()
{
    int irid;

    
    // enable I/O privilege
    if(ThreadCtl (_NTO_TCTL_IO, NULL) == -1)
    {
    	printf(" Permission denied\n");
    	return -1;
    }

    event.sigev_notify = SIGEV_INTR;

    // attach the ISR to IRQ 8
    irid = InterruptAttach_r(0x8, isr_handler, NULL, 0,_NTO_INTR_FLAGS_TRK_MSK);

	if(irid == -1)
	{
		printf(" Interrupt Attach failed\n");
		return -1;
	}
	while (1)
	{

		    InterruptUnmask(0x8,irid);
		    InterruptWait (0, NULL);
                     }
	InterruptDetach(irid);
    return 0;

}

// this is the ISR
const struct sigevent *isr_handler (void *arg, int id)
{
    printf(" INTR\n");
    printf("########## ISR ##################\n");
    
    return (&event);
}


Please help me on this..

Regards
K.Senthil