hello,
if I use INT1,the service function define interrupt number 2 then it can jump to 0x0013 and excutes the INT1 function;
but if I want EP4 give its buffer data to external RAM when its buffer has data,how can I configure it? I have tired the code below(reference cy3681_ez_usb_fx2_development_kit_15), but how it jumps to EP4_ISR by keil. actually I think it should jump to 0x0003 and excutes INT0.
void ISR_Ep4inout(void) interrupt 0
{
EZUSB_IRQ_CLEAR(); //EXIF.4=USBINT 0 clear
EPIRQ = bmBIT5; //
EP4_RAM();
}
here is the code I reference:
void ISR_Ep1out(void) interrupt 0
{
BYTE count;
BYTE i;
count = EP1OUTBC;
if(!(EP1INCS & bmBIT1))
{
for (i=0;i<count; i++)
{
EP1INBUF[i]=EP1OUTBUF[i];
}
EP1INBC =count;
}
EZUSB_IRQ_CLEAR();
EPIRQ = bmBIT3;
}
void ISR_Ep2inout(void) interrupt 0
{
WORD count;
WORD i;
if(!(EP2468STAT & bmEP6FULL))
{ // check EP6 FULL(busy) bit in EP2468STAT (SFR), core set's this bit when FIFO is full
APTR1H = MSB( &EP2FIFOBUF );
APTR1L = LSB( &EP2FIFOBUF );
AUTOPTRH2 = MSB( &EP6FIFOBUF );
AUTOPTRL2 = LSB( &EP6FIFOBUF );
count = (EP2BCH << 8) + EP2BCL;
// loop EP2OUT buffer data to EP6IN
for( i = 0x0000; i < count; i++ )
{
// setup to transfer EP2OUT buffer to EP6IN buffer using AUTOPOINTER(s)
EXTAUTODAT2 = EXTAUTODAT1;
}
EP6BCH = EP2BCH;
SYNCDELAY;
EP6BCL = EP2BCL; // arm EP6IN
SYNCDELAY;
}
EZUSB_IRQ_CLEAR();
EPIRQ = bmBIT4;
}
|