remove unnecessary blocking operation.
add comments why resume event is sent manually.
This commit is contained in:
parent
3019c6eb40
commit
1ff3b76451
|
@ -553,7 +553,6 @@ void dcd_remote_wakeup(uint8_t rhport)
|
||||||
{
|
{
|
||||||
(void)rhport;
|
(void)rhport;
|
||||||
USB0.DVSTCTR0.BIT.WKUP = 1;
|
USB0.DVSTCTR0.BIT.WKUP = 1;
|
||||||
while (USB0.DVSTCTR0.BIT.WKUP) ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void dcd_connect(uint8_t rhport)
|
void dcd_connect(uint8_t rhport)
|
||||||
|
@ -701,6 +700,11 @@ void dcd_int_handler(uint8_t rhport)
|
||||||
}
|
}
|
||||||
if (is0 & USB_IS0_SOFR) {
|
if (is0 & USB_IS0_SOFR) {
|
||||||
if (_dcd.suspended) {
|
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_event_bus_signal(rhport, DCD_EVENT_RESUME, true);
|
||||||
_dcd.suspended = 0;
|
_dcd.suspended = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue