Esempio n. 1
0
/**
	Local function to handle outgoing bulk data
		
	@param [in] bEP
	@param [in] bEPStatus
 */
static void BulkIn(U8 bEP, U8 bEPStatus)
{
    DBG("\nBi\n");
	if( !(bEPStatus & EP_STATUS_NACKED) ) {
		return;
	}
    
	SendNextBulkIn(bEP, FALSE);
}
Esempio n. 2
0
/* Main Program */
int main (void) {
  int j=0;  
  processorInit();
  init_VIC(); //necessary 5-17-2006 EDM
  //initialize the motion control subsystem
  if( !init_motion_control() )
    status_led(MOTION_INIT_ERR);
  init_status_led();
  for(j=0; j<1000000; j++); //short delay here 
  //initialize USB
  usbSetup();
  //if we made it this far, blink to show health
  status_led(HEALTHY);
  while (1)                                /* Loop forever */
  {
	  //Allow USB to send information if any needs to be send
	  SendNextBulkIn(BULK_IN_EP);
  }										   
}
Esempio n. 3
0
/**
	Local function to handle incoming bulk data
		
	@param [in] bEP
	@param [in] bEPStatus
 */
static void BulkOut(U8 bEP, U8 bEPStatus)
{
	int i, iLen;
	int j = 0;

	//DBG ("\nBulk Out...\n");
	DBG ("\nBo\n");

	if( !(bEPStatus & EP_STATUS_DATA) ) {
		return;
	}
	
	if (fifo_free(&bulk_txfifo) <= MAX_PACKET_SIZE_BULK) {
		// may not fit into fifo
		return;
	}

	// get data from USB into intermediate buffer (bulk_rxfifo)
	iLen = USBHwEPRead(bEP, bulkBuf, sizeof(bulkBuf));
	DBG("l=%d", iLen);
	for (i = 0; i < iLen; i++) {
		// put into FIFO
	/* 	if (!fifo_put(&bulk_rxfifo, bulkBuf[i])) { */
/* 			// overflow... :( */
/* 			ASSERT(FALSE); */
/* 			break; */
/* 		} */
 	        // copy rxfifo to txfifo? seems right for echo case...
		if (!fifo_put(&bulk_txfifo, bulkBuf[i])) {
			// overflow... :(
			ASSERT(FALSE);
			break;
		} else {
		    //DBG("%c",bulkBuf[i]);
		}
	}
	
	SendNextBulkIn(BULK_IN_EP, 0);
}
Esempio n. 4
0
/**
	Local function to handle outgoing bulk data
		
	@param [in] bEP
	@param [in] bEPStatus
 */
static void BulkIn(uint8_t bEP, uint8_t bEPStatus)
{
	SendNextBulkIn(bEP, FALSE);
}