MASTER版本。见红色字体,疑问:bulk transfer附加0长度报文应该只针对out方向吧?我理解应该是!is_in ...
static inline void _buffer_fill_bulk(dma_buffer_block_t *buffer, usb_transfer_t *transfer, bool is_in)
{
if (is_in) {
usbh_hal_xfer_desc_fill(buffer->xfer_desc_list, 0, transfer->data_buffer, transfer->num_bytes,
USBH_HAL_XFER_DESC_FLAG_IN | USBH_HAL_XFER_DESC_FLAG_HOC);
} else if (transfer->flags & USB_TRANSFER_FLAG_ZERO_PACK) {
//We need to add an extra zero length packet, so two descriptors are used
usbh_hal_xfer_desc_fill(buffer->xfer_desc_list, 0, transfer->data_buffer, transfer->num_bytes, 0);
usbh_hal_xfer_desc_fill(buffer->xfer_desc_list, 1, NULL, 0, USBH_HAL_XFER_DESC_FLAG_HOC);
} else {
usbh_hal_xfer_desc_fill(buffer->xfer_desc_list, 0, transfer->data_buffer, transfer->num_bytes, USBH_HAL_XFER_DESC_FLAG_HOC);
}
//Update buffer flags
buffer->flags.bulk.zero_len_packet = (is_in && (transfer->flags & USB_TRANSFER_FLAG_ZERO_PACK)) ? 1 : 0;
}
hcd.c中的zero_len_packet标志设置问题
Re: hcd.c中的zero_len_packet标志设置问题
是的,这个问题上周已经在内部得到修复了,目前还没同步出去,感谢您的关注和支持。
Re: hcd.c中的zero_len_packet标志设置问题
驱动提供的 USB_TRANSFER_FLAG_ZERO_PACK 定义和用法有点问题。理想行为应该和 LIBUSB 的 LIBUSB_TRANSFER_ADD_ZERO_PACKET 一样。我会修改。
Who is online
Users browsing this forum: Google [Bot] and 87 guests