remove unnecessary blocking operation.

add comments why resume event is sent manually.
This commit is contained in:
kkitayam 2021-07-05 21:27:08 +09:00
parent 3019c6eb40
commit 1ff3b76451
1 changed files with 5 additions and 1 deletions

View File

@ -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;
}