aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/src/usbh/hal_usbh_msd.c
diff options
context:
space:
mode:
authorDiego Ismirlian <dismirlian (at) google's mail.com>2017-06-08 12:36:30 -0300
committerDiego Ismirlian <dismirlian (at) google's mail.com>2017-06-08 12:36:30 -0300
commitb9f0fc24c59702e51b205f1ee9295bcaee71cb07 (patch)
tree5b121b87de3c535a540657fd41bfb0abb4f43959 /os/hal/src/usbh/hal_usbh_msd.c
parentf82de84347a64f4a826806696d23a61e60bd9115 (diff)
downloadChibiOS-Contrib-b9f0fc24c59702e51b205f1ee9295bcaee71cb07.tar.gz
ChibiOS-Contrib-b9f0fc24c59702e51b205f1ee9295bcaee71cb07.tar.bz2
ChibiOS-Contrib-b9f0fc24c59702e51b205f1ee9295bcaee71cb07.zip
USBH: fix Mass Storage Driver EP reset status bug
Diffstat (limited to 'os/hal/src/usbh/hal_usbh_msd.c')
-rw-r--r--os/hal/src/usbh/hal_usbh_msd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/os/hal/src/usbh/hal_usbh_msd.c b/os/hal/src/usbh/hal_usbh_msd.c
index 121e730..b564e8e 100644
--- a/os/hal/src/usbh/hal_usbh_msd.c
+++ b/os/hal/src/usbh/hal_usbh_msd.c
@@ -347,7 +347,7 @@ static msd_bot_result_t _msd_bot_transaction(msd_transaction_t *tran, USBHMassSt
if (status == USBH_URBSTATUS_STALL) {
uerrf("\tMSD: Data phase: USBH_URBSTATUS_STALL, clear halt");
- status = usbhEPReset(ep);
+ status = (usbhEPReset(ep) == HAL_SUCCESS) ? USBH_URBSTATUS_OK : USBH_URBSTATUS_ERROR;
}
if (status != USBH_URBSTATUS_OK) {
@@ -365,7 +365,7 @@ static msd_bot_result_t _msd_bot_transaction(msd_transaction_t *tran, USBHMassSt
if (status == USBH_URBSTATUS_STALL) {
uwarn("\tMSD: Status phase: USBH_URBSTATUS_STALL, clear halt and retry");
- status = usbhEPReset(&lunp->msdp->epin);
+ status = (usbhEPReset(&lunp->msdp->epin) == HAL_SUCCESS) ? USBH_URBSTATUS_OK : USBH_URBSTATUS_ERROR;
if (status == USBH_URBSTATUS_OK) {
status = usbhBulkTransfer(&lunp->msdp->epin, &csw,