Ejemplo n.º 1
0
/*******************************************************************************
* Function Name  : SOF_Callback / INTR_SOFINTR_Callback (USB Start Of Frame)
* Description    :
* Input          : None.
* Output         : None.
* Return         : None.
*******************************************************************************/
void SOF_Callback(void) {
	static uint32_t FrameCount = 0;

	if(bDeviceState == CONFIGURED) {
		if (FrameCount++ == VCOMPORT_IN_FRAME_INTERVAL) {
			// Reset the frame counter
			FrameCount = 0;
			// Check the data to be sent through IN pipe
			Handle_USBAsynchXfer();
		}
	}
}
/**
  * @brief  usbd_audio_SOF
  *         Start Of Frame event management
  * @param  pdev: instance
  * @param  epnum: endpoint number
  * @retval status
  */
static uint8_t  usbd_cdc_SOF (void *pdev)
{
    static uint32_t FrameCount = 0;

    if (FrameCount++ == CDC_IN_FRAME_INTERVAL) {
        /* Reset the frame counter */
        FrameCount = 0;

        /* Check the data to be sent through IN pipe */
        Handle_USBAsynchXfer(pdev);
    }

    return USBD_OK;
}
Ejemplo n.º 3
0
void SOF_Callback(void)
#endif /* STM32F10X_CL */
{
  static uint32_t FrameCount = 0;
  
  if(bDeviceState == CONFIGURED)
  {
    if (FrameCount++ == VCOMPORT_IN_FRAME_INTERVAL)
    {
      /* Reset the frame counter */
      FrameCount = 0;
      
      /* Check the data to be sent through IN pipe */
      Handle_USBAsynchXfer();
    }
  }  
}
Ejemplo n.º 4
0
/**
  * @brief  usbd_audio_SOF
  *         Start Of Frame event management
  * @param  pdev: instance
  * @param  epnum: endpoint number
  * @retval status
  */
static uint8_t  usbd_cdc_msc_SOF (void *pdev)
{
  static uint32_t FrameCount = 0;

  if (FrameCount++ == CDC_IN_FRAME_INTERVAL)
  {
    /* Reset the frame counter */
    FrameCount = 0;

    // Do not send data if terminal is not present - NEZ
    if (USB_DTE_Present)
	/* Check the data to be sent through IN pipe */
	Handle_USBAsynchXfer(pdev);
  }

  return USBD_OK;
}
Ejemplo n.º 5
0
/*******************************************************************************
* Function Name  : SOF_Callback / INTR_SOFINTR_Callback
* Description    :
* Input          : None.
* Output         : None.
* Return         : None.
*******************************************************************************/
void SOF_Callback(void)
{
  jshKickUSBWatchdog();
  /* If this times out, then we know that USB has disconnected */

  static uint32_t FrameCount = 0;
  
  if(bDeviceState == CONFIGURED)
  {
    SetEPRxStatus(ENDP3, jshHasEventSpaceForChars(VIRTUAL_COM_PORT_DATA_SIZE) ? EP_RX_VALID : EP_RX_NAK);
   

    if (FrameCount++ == VCOMPORT_IN_FRAME_INTERVAL)
    {
      /* Reset the frame counter */
      FrameCount = 0;
      
      /* Check the data to be sent through IN pipe */
      Handle_USBAsynchXfer();
    }
  }  
}
Ejemplo n.º 6
0
/*******************************************************************************
* Function Name  : EP1_IN_Callback (OUT transfers: from host to device)
* Description    :
* Input          : None.
* Output         : None.
* Return         : None.
*******************************************************************************/
void EP1_IN_Callback (void) {
	Handle_USBAsynchXfer();
}