/* check CDC ACM is ready for data transfer  */
uint8_t cdc_acm_check_ready(usb_dev *udev)
/* check CDC ACM is ready for data transfer  */
uint8_t cdc_acm_check_ready(usb_dev *udev)
{
    if (udev->class_data[CDC_COM_INTERFACE] != NULL) {
        usb_cdc_handler *cdc = (usb_cdc_handler *)udev->class_data[CDC_COM_INTERFACE];
        if ((1U == cdc->packet_receive) && (1U == cdc->pre_packet_send)) {
            return 0U;
        }
    }
    return 5U;
}