summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhichard <[email protected]>2018-11-07 22:48:50 +0800
committerhichard <[email protected]>2018-11-07 22:48:50 +0800
commitca4b48aac25efcb54c3d69779aba01731734d823 (patch)
tree5c86bb5ddaa1149edf1ec9f25294b9415c7e08d3
parent9d55baa7c6e01368fe8046a440e8e6462125a76c (diff)
修复STM32F4-Hal bsp USB主机驱动的一个bug
-rw-r--r--bsp/stm32f4xx-HAL/drivers/drv_usbh.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/bsp/stm32f4xx-HAL/drivers/drv_usbh.c b/bsp/stm32f4xx-HAL/drivers/drv_usbh.c
index 6065e06f8e..e002c2f7e6 100644
--- a/bsp/stm32f4xx-HAL/drivers/drv_usbh.c
+++ b/bsp/stm32f4xx-HAL/drivers/drv_usbh.c
@@ -179,6 +179,9 @@ static int drv_pipe_xfer(upipe_t pipe, rt_uint8_t token, void *buffer, int nbyte
{
pipe->callback(pipe);
}
+ if (pipe->ep.bEndpointAddress & 0x80) {
+ return HAL_HCD_HC_GetXferCount(&_stm_hhcd_fs, pipe->pipe_index);
+ }
return nbytes;
}
return -1;