/* Handle Bulk Out Endpoint Received Data. 
The function handles data received on the Bulk Out endpoint. It reads the received data to the receive intermediate buffer if there is enough space available.  */
static void USBD_CDC_ACM_EP_BULKOUT_HandleData()
/* Handle Bulk Out Endpoint Received Data. 
The function handles data received on the Bulk Out endpoint. It reads the received data to the receive intermediate buffer if there is enough space available.  */
static void USBD_CDC_ACM_EP_BULKOUT_HandleData()
{
    uint32_t len_free_to_recv;
    int32_t len_received;
    if ((usbd_cdc_acm_receivebuf_sz - (ptr_data_received - USBD_CDC_ACM_ReceiveBuf)) >= usbd_cdc_acm_maxpacketsize1[USBD_HighSpeed]) {
        len_free_to_recv = usbd_cdc_acm_receivebuf_sz - (ptr_data_received - USBD_CDC_ACM_ReceiveBuf);
        len_received       = USBD_ReadEP(usbd_cdc_acm_ep_bulkout, ptr_data_received, len_free_to_recv);
        ptr_data_received += len_received;
        if (data_received_pending_pckts &&
                !data_receive_int_access) {
            data_received_pending_pckts--;
        }
    } else {
        data_no_space_for_receive = 1;
        if (data_receive_int_access) {
            data_received_pending_pckts++;
        }
    }
}