summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkkitayam <[email protected]>2021-07-05 21:27:08 +0900
committerkkitayam <[email protected]>2021-07-05 21:27:08 +0900
commit1ff3b76451c446cfd79fb7728f4e457e4dc0d7cb (patch)
tree1628fc0779f441c8d67736914e62a115e1513064
parent3019c6eb40f5e577a5075a4fccd275c5537c5a34 (diff)
remove unnecessary blocking operation.
add comments why resume event is sent manually.
-rw-r--r--src/portable/renesas/usba/dcd_usba.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/portable/renesas/usba/dcd_usba.c b/src/portable/renesas/usba/dcd_usba.c
index fa584945e..338d5b0e6 100644
--- a/src/portable/renesas/usba/dcd_usba.c
+++ b/src/portable/renesas/usba/dcd_usba.c
@@ -553,7 +553,6 @@ void dcd_remote_wakeup(uint8_t rhport)
{
(void)rhport;
USB0.DVSTCTR0.BIT.WKUP = 1;
- while (USB0.DVSTCTR0.BIT.WKUP) ;
}
void dcd_connect(uint8_t rhport)
@@ -701,6 +700,11 @@ void dcd_int_handler(uint8_t rhport)
}
if (is0 & USB_IS0_SOFR) {
if (_dcd.suspended) {
+ /* When USB host resumes caused by `dcd_remote_wakeup()`,
+ * RESM interrupt does not rise.
+ * Therefore we need to manually send resume event.
+ * Of course, when USB host resumes on its own,
+ * RESM interrupt rise properly, then this statements are ignored. */
dcd_event_bus_signal(rhport, DCD_EVENT_RESUME, true);
_dcd.suspended = 0;
}