summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkkitayam <[email protected]>2021-08-31 00:14:39 +0900
committerkkitayam <[email protected]>2021-09-07 23:28:54 +0900
commitf3da48d46adac415846985643c1b6d04c3866b94 (patch)
treed7374105cce1543d93847e27a4ea427c5b3ab0ec /src
parente06a632b72aa926473375a2ed97d142196429d7f (diff)
Implement dcd_edpt_close_all() for Renesas RX family
Diffstat (limited to 'src')
-rw-r--r--src/portable/renesas/usba/dcd_usba.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/portable/renesas/usba/dcd_usba.c b/src/portable/renesas/usba/dcd_usba.c
index a837b5724..8e2e3dc26 100644
--- a/src/portable/renesas/usba/dcd_usba.c
+++ b/src/portable/renesas/usba/dcd_usba.c
@@ -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)