|
|
@@ -733,10 +733,16 @@ bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * ep_desc)
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-void dcd_edpt_close_all (uint8_t rhport)
|
|
|
+void dcd_edpt_close_all(uint8_t rhport)
|
|
|
{
|
|
|
- (void) rhport;
|
|
|
- // TODO implement dcd_edpt_close_all()
|
|
|
+ unsigned i = TU_ARRAY_SIZE(_dcd.pipe);
|
|
|
+ dcd_int_disable(rhport);
|
|
|
+ while (--i) { /* Close all pipes except 0 */
|
|
|
+ const unsigned ep_addr = _dcd.pipe[i].ep;
|
|
|
+ if (!ep_addr) continue;
|
|
|
+ dcd_edpt_close(rhport, ep_addr);
|
|
|
+ }
|
|
|
+ dcd_int_enable(rhport);
|
|
|
}
|
|
|
|
|
|
void dcd_edpt_close(uint8_t rhport, uint8_t ep_addr)
|