Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ArduinoCore-avr
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
ArduinoCore-avr
Commits
a0398244
Commit
a0398244
authored
Jul 21, 2016
by
Martino Facchin
Committed by
GitHub
Jul 21, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5135 from facchinm/usbsuspend_resume
Send an USB remote wakeup if data need to be written
parents
0f86786b
7874386c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
cores/arduino/USBCore.cpp
cores/arduino/USBCore.cpp
+7
-1
No files found.
cores/arduino/USBCore.cpp
View file @
a0398244
/* 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)
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment