cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
7,499 Views
Registered: ‎04-16-2008

questionon Xintc_Connect

Hi All,
Iam trying to run a slideshow example program on xupv2pro.
tools used: edk8.2i
I modified this slideshow example to run based on push button press. and to this, I also added an interrupt. Now, upon push button press, an interrupt action has to take place. This should call the interrupt handler function. But in my case, it does not get into interrupt handler function.
here is the code that Iam currently working on. Please give me some suggestions of how to go about this issue.
int main()
{
int status;
int psb_check;
count = 0;
print("\r\nTurning caches on");
XCache_EnableDCache(0xF000000F);
XCache_EnableICache(0xF000000F);
/* get images */
print("\r\nProgram running.\n\r");
count = get_images();
print("\n\rReads done\n\r");
/* set TFT pointer */
XIo_Out32(0xD0000040, IMAGE_BASEADDR);
XIo_Out32(0xD0000044, 0x1); // turn on display
// user added code for interrupt
XGpio_Initialize(&PushButtons_5Bit, XPAR_PUSHBUTTONS_5BIT_DEVICE_ID);// newly added statement
XGpio_mSetDataDirection(&PushButtons_5Bit, 1, 0xffffffff);// newly added statement
psb_check = XGpio_DiscreteRead(&PushButtons_5Bit, 1);
xil_printf("Push Button Status %x\r\n", psb_check);
XGpio_InterruptEnable(&PushButtons_5Bit, XGPIO_IR_CH1_MASK);
XGpio_InterruptGlobalEnable(&PushButtons_5Bit);
XIntc_Initialize(&opb_intc_0, XPAR_OPB_INTC_0_DEVICE_ID);
XIntc_Connect(&opb_intc_0, XPAR_OPB_INTC_0_PUSHBUTTONS_5BIT_IP2INTC_IRPT_INTR, (XInterruptHandler)push_int_handler, &PushButtons_5Bit);
XIntc_Start(&opb_intc_0, XIN_REAL_MODE);
XIntc_Enable(&opb_intc_0, XPAR_OPB_INTC_0_PUSHBUTTONS_5BIT_IP2INTC_IRPT_INTR);
XExc_Init();
XExc_RegisterHandler(XEXC_ID_NON_CRITICAL_INT, (XExceptionHandler)XIntc_InterruptHandler, &opb_intc_0);
XExc_mEnableExceptions(XEXC_ALL);//(XEXC_NON_CRITICAL);
// XIntc_Enable(&opb_intc_0, XPAR_OPB_INTC_0_PUSHBUTTONS_5BIT_IP2INTC_IRPT_INTR);
// xil_printf("fffaaaf");

//step_images(IMAGE_BASEADDR, count); // infinite loop
// return 0;

print("Main function done \r\n\r\n\r\n");
//while(1){
//}
status = XGpio_mGetDataReg(XPAR_PUSHBUTTONS_5BIT_BASEADDR,1);
xil_printf(" status = %x\r\n", status);
}


//My interrupt handler funtion
void push_int_handler(void *baseaddr_p){
//XGpio PushButtons_5Bit;// newly added statement
print("\r\n yes");

int psb_check;// newly added statement
Xuint32 baseaddr ;
Xuint32 count1 ;
baseaddr = IMAGE_BASEADDR;
count1 = count;
unsigned int i, j;
...................
............

Upon Interrupt, the function push_int_handler should be called,but that dint happen.

Message Edited by tamus_1983 on 05-11-2008 03:23 PM
0 Kudos
0 Replies