STM/STM32_LIBRARIES/USB_Device/Class/CDC/Src/usbd_cdc_if.c
static int8_t VCP_Init(USBD_HandleTypeDef* pdev) {
#ifdef USB_USE_FS
	/* Set RX buffer */
	if (pdev->id == USB_ID_FS) {
		USBD_CDC_SetRxBuffer(pdev, FS_TMP_RX_Buff);
	}
#endif
#ifdef USB_USE_HS
	/* Set RX buffer */
	if (pdev->id == USB_ID_HS) {
		USBD_CDC_SetRxBuffer(pdev, HS_TMP_RX_Buff);
	}
#endif
	
	/* Return OK */
	return USBD_OK;
}
/********************************************************/
/*          Single functions for both USB modes         */
/********************************************************/
Single functions for both USB modes
Single functions for both USB modes
static int8_t VCP_Init(USBD_HandleTypeDef* pdev) {
#ifdef USB_USE_FS
	if (pdev->id == USB_ID_FS) {
		USBD_CDC_SetRxBuffer(pdev, FS_TMP_RX_Buff);
	}
#endif
#ifdef USB_USE_HS
	if (pdev->id == USB_ID_HS) {
		USBD_CDC_SetRxBuffer(pdev, HS_TMP_RX_Buff);
	}
#endif
	return USBD_OK;
}
static int8_t VCP_Init ( USBD_HandleTypeDef * pdev ) { #ifdef USB_USE_FS if ( pdev -> id == USB_ID_FS ) { USBD_CDC_SetRxBuffer ( pdev , FS_TMP_RX_Buff ) ; } #endif #ifdef USB_USE_HS if ( pdev -> id == USB_ID_HS ) { USBD_CDC_SetRxBuffer ( pdev , HS_TMP_RX_Buff ) ; } #endif return USBD_OK ; }
Single functions for both USB modes
Single functions for both USB modes
/* Set RX buffer */ /* Set RX buffer */ /* Return OK */