Merge pull request #5135 from facchinm/usbsuspend_resume
Send an USB remote wakeup if data need to be written
This commit is contained in:
commit
a03982445a
|
@ -1,6 +1,7 @@
|
||||||
|
|
||||||
|
|
||||||
/* Copyright (c) 2010, Peter Barrett
|
/* Copyright (c) 2010, Peter Barrett
|
||||||
|
** Sleep/Wakeup support added by Michael Dreher
|
||||||
**
|
**
|
||||||
** Permission to use, copy, modify, and/or distribute this software for
|
** Permission to use, copy, modify, and/or distribute this software for
|
||||||
** any purpose with or without fee is hereby granted, provided that the
|
** any purpose with or without fee is hereby granted, provided that the
|
||||||
|
@ -266,6 +267,11 @@ int USB_Send(u8 ep, const void* d, int len)
|
||||||
if (!_usbConfiguration)
|
if (!_usbConfiguration)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
if (_usbSuspendState & (1<<SUSPI)) {
|
||||||
|
//send a remote wakeup
|
||||||
|
UDCON |= (1 << RMWKUP);
|
||||||
|
}
|
||||||
|
|
||||||
int r = len;
|
int r = len;
|
||||||
const u8* data = (const u8*)d;
|
const u8* data = (const u8*)d;
|
||||||
u8 timeout = 250; // 250ms timeout on send? TODO
|
u8 timeout = 250; // 250ms timeout on send? TODO
|
||||||
|
|
Loading…
Reference in New Issue