summaryrefslogtreecommitdiff
path: root/src/class/msc
diff options
context:
space:
mode:
authorhathach <[email protected]>2021-09-07 13:30:51 +0700
committerhathach <[email protected]>2021-09-07 13:30:51 +0700
commitf47e5402fa928c5a0cd581c894e9e18c3dfcbdfb (patch)
treed44efc1b2e322cc6189e21ed66553914ab25b231 /src/class/msc
parentfa030075c228390741e450664506892d317c0038 (diff)
add msc workaround for cxd56
Diffstat (limited to 'src/class/msc')
-rw-r--r--src/class/msc/msc_device.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/class/msc/msc_device.c b/src/class/msc/msc_device.c
index 6b3a392a8..0fd592129 100644
--- a/src/class/msc/msc_device.c
+++ b/src/class/msc/msc_device.c
@@ -611,6 +611,17 @@ bool mscd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t event, uint32_t
TU_ASSERT( send_csw(rhport, p_msc) );
}
}
+
+ #if TU_CHECK_MCU(CXD56)
+ // WORKAROUND: cxd56 has its own nuttx usb stack which does not forward Set/ClearFeature(Endpoint) to DCD.
+ // There is no way for us to know when EP is un-stall, therefore we will unconditionally un-stall here and
+ // hope everything will work
+ if ( usbd_edpt_stalled(rhport, p_msc->ep_in) )
+ {
+ usbd_edpt_clear_stall(rhport, p_msc->ep_in);
+ send_csw(rhport, p_msc);
+ }
+ #endif
}
return true;