@philip,@donq
After some change in my code i reslove my problem now my code look like.
write()
{
//data write code
//enable NFC
/*************NEW CODE ADED*************/
IOWR(NFC_BASE,NFC_IRQ_CLR,0);
IOWR(NFC_BASE,NFC_IRQ_MASK,0x01);
alt_irq_enable(NFC_BASE);
/**************************************/
while(intrstat == 0);
intrstat = 0;//globel variable
}
read()
{
//data read code
//enable NFC
/*************NEW CODE ADED*************/
IOWR(NFC_BASE,NFC_IRQ_CLR,0);
IOWR(NFC_BASE,NFC_IRQ_MASK,0x01);
alt_irq_enable(NFC_BASE);
/**************************************/
while(intrstat == 0);
intrstat = 0;
}
main()
{
IOWR(LED_BASE,0,0);
alt_irq_register(NFC_IRQ,edge_capture_ptr,handle_n fc_interrupts);
alt_irq_enable(NFC_BASE);
write();
read();
}
static void handle_nfc_interrupts(void* context, alt_u32 id)
{
volatile int* irq_capture_ptr = (volatile int*) context;
irq_capture_ptr = IORD(ONFI_BASE,NFC_STATUS);
alt_irq_disable(ONFI_BASE);
IOWR(LED_BASE,0,1);
intrstat = 1;
}
But now my problem is when i issue write or read API back to Back or say in for loop(say 10 times) it just suspended in RUN mode in NIOS II.but it's work very well in Debug mode.
so what i make change in above code to solve above problem.................
Thanks to Philipp,donq to give time for me.
Have a nice Weekend!!!!!!!!!!!!!!!!!!!
Regards,
Jayesh