OpenCores
URL https://opencores.org/ocsvn/gecko3/gecko3/trunk

Subversion Repositories gecko3

[/] [gecko3/] [trunk/] [GECKO3COM/] [gecko3com-fw/] [firmware/] [src/] [gecko3com_gpif.c] - Diff between revs 20 and 21

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 20 Rev 21
Line 93... Line 93...
  /* check if this is a end of a IN transfer */
  /* check if this is a end of a IN transfer */
  if((flGPIF & bmGPIF_READ_IN_PROGRESS) == bmGPIF_READ_IN_PROGRESS){
  if((flGPIF & bmGPIF_READ_IN_PROGRESS) == bmGPIF_READ_IN_PROGRESS){
    INPKTEND = USB_TMC_EP_IN;
    INPKTEND = USB_TMC_EP_IN;
  }
  }
 
 
 
  //EA = 0;             /* disable all interrupts */
  while(!(GPIFTRIG & bmGPIF_IDLE));
  while(!(GPIFTRIG & bmGPIF_IDLE));
 
  //EA = 1;             /* global interrupt enable */
 
 
  /* check if there is data available for an OUT transfer */
  /* check if there is data available for an OUT transfer */
  if((flGPIF & bmGPIF_PENDING_DATA) == bmGPIF_PENDING_DATA) {
  //if((flGPIF & bmGPIF_PENDING_DATA) == bmGPIF_PENDING_DATA) {
    //if(!(EP2468STAT & bmEP2EMPTY)) {
    //if(!(EP2468STAT & bmEP2EMPTY)) {
    flGPIF &= ~bmGPIF_PENDING_DATA;
    //flGPIF &= ~bmGPIF_PENDING_DATA;
 
 
    gpif_trigger_write();
    //EA = 0;           /* disable all interrupts */
    flGPIF &= ~bmGPIF_READ_IN_PROGRESS;
    //flGPIF &= ~bmGPIF_READ_IN_PROGRESS;
  }
    //gpif_trigger_write();
  else {
    //EA = 1;           /* global interrupt enable */
    gpif_trigger_read();
  //}
 
  /*else*/ {
 
    EA = 0;              /* disable all interrupts */
    flGPIF |= bmGPIF_READ_IN_PROGRESS;
    flGPIF |= bmGPIF_READ_IN_PROGRESS;
 
    gpif_trigger_read();
 
    EA = 1;             /* global interrupt enable */
  }
  }
 
 
  clear_fifo_gpif_irq();
  clear_fifo_gpif_irq();
 
 
  ISR_DEBUG_PORT &= ~bmGPIF_DONE;
  ISR_DEBUG_PORT &= ~bmGPIF_DONE;
Line 127... Line 133...
  /* check if there is a active IN transfer */
  /* check if there is a active IN transfer */
  if((GPIFREADYSTAT & bmWRX) == bmWRX) {
  if((GPIFREADYSTAT & bmWRX) == bmWRX) {
    flGPIF |= bmGPIF_PENDING_DATA;
    flGPIF |= bmGPIF_PENDING_DATA;
  }
  }
  else {
  else {
 
    //EA = 0;           /* disable all interrupts */
 
    if((flGPIF & bmGPIF_READ_IN_PROGRESS) == bmGPIF_READ_IN_PROGRESS) {
    GPIFABORT = 0xFF;
    GPIFABORT = 0xFF;
    SYNCDELAY;
    SYNCDELAY;
 
      flGPIF &= ~bmGPIF_READ_IN_PROGRESS;
 
    }
 
    //EA = 1;           /* global interrupt enable */
 
    //EA = 0;           /* disable all interrupts */
    while(!(GPIFTRIG & bmGPIF_IDLE));
    while(!(GPIFTRIG & bmGPIF_IDLE));
    gpif_trigger_write();
    //EA = 1;           /* global interrupt enable */
 
    EA = 0;              /* disable all interrupts */
    flGPIF &= ~bmGPIF_READ_IN_PROGRESS;
    flGPIF &= ~bmGPIF_READ_IN_PROGRESS;
 
    gpif_trigger_write();
 
    EA = 1;             /* global interrupt enable */
  }
  }
 
 
  clear_fifo_gpif_irq();
  clear_fifo_gpif_irq();
 
 
  ISR_DEBUG_PORT &= ~bmFIFO_PF;
  ISR_DEBUG_PORT &= ~bmFIFO_PF;
Line 225... Line 240...
 
 
  EA = 1;               /* global interrupt enable */
  EA = 1;               /* global interrupt enable */
 
 
 
 
  /* start gpif read, default state of the gpif to wait for fpga data */
  /* start gpif read, default state of the gpif to wait for fpga data */
 
  flGPIF |= bmGPIF_READ_IN_PROGRESS;
  gpif_trigger_read();
  gpif_trigger_read();
 
 
}
}
 
 
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.