Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Arduino Core for SAMD21 CPU
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
josc941e
Arduino Core for SAMD21 CPU
Commits
f3a29a7d
Commit
f3a29a7d
authored
8 years ago
by
Arturo Guadalupi
Browse files
Options
Downloads
Plain Diff
Merge pull request #143 from sandeepmistry/cdc-write-return-value
Correct SerialUSB return value
parents
2df644e6
8d0c1674
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cores/arduino/USB/CDC.cpp
+1
-1
1 addition, 1 deletion
cores/arduino/USB/CDC.cpp
cores/arduino/USB/USBCore.cpp
+3
-1
3 additions, 1 deletion
cores/arduino/USB/USBCore.cpp
with
4 additions
and
2 deletions
cores/arduino/USB/CDC.cpp
+
1
−
1
View file @
f3a29a7d
...
@@ -262,7 +262,7 @@ size_t Serial_::write(const uint8_t *buffer, size_t size)
...
@@ -262,7 +262,7 @@ size_t Serial_::write(const uint8_t *buffer, size_t size)
{
{
uint32_t
r
=
usb
.
send
(
CDC_ENDPOINT_IN
,
buffer
,
size
);
uint32_t
r
=
usb
.
send
(
CDC_ENDPOINT_IN
,
buffer
,
size
);
if
(
r
==
0
)
{
if
(
r
>
0
)
{
return
r
;
return
r
;
}
else
{
}
else
{
setWriteError
();
setWriteError
();
...
...
This diff is collapsed.
Click to expand it.
cores/arduino/USB/USBCore.cpp
+
3
−
1
View file @
f3a29a7d
...
@@ -605,6 +605,7 @@ uint8_t USBDeviceClass::armRecv(uint32_t ep)
...
@@ -605,6 +605,7 @@ uint8_t USBDeviceClass::armRecv(uint32_t ep)
// Blocking Send of data to an endpoint
// Blocking Send of data to an endpoint
uint32_t
USBDeviceClass
::
send
(
uint32_t
ep
,
const
void
*
data
,
uint32_t
len
)
uint32_t
USBDeviceClass
::
send
(
uint32_t
ep
,
const
void
*
data
,
uint32_t
len
)
{
{
uint32_t
written
=
0
;
uint32_t
length
=
0
;
uint32_t
length
=
0
;
if
(
!
_usbConfiguration
)
if
(
!
_usbConfiguration
)
...
@@ -675,10 +676,11 @@ uint32_t USBDeviceClass::send(uint32_t ep, const void *data, uint32_t len)
...
@@ -675,10 +676,11 @@ uint32_t USBDeviceClass::send(uint32_t ep, const void *data, uint32_t len)
while
(
!
usbd
.
epBank1IsTransferComplete
(
ep
))
{
while
(
!
usbd
.
epBank1IsTransferComplete
(
ep
))
{
;
// need fire exit.
;
// need fire exit.
}
}
written
+=
length
;
len
-=
length
;
len
-=
length
;
data
=
(
char
*
)
data
+
length
;
data
=
(
char
*
)
data
+
length
;
}
}
return
l
en
;
return
writt
en
;
}
}
uint32_t
USBDeviceClass
::
armSend
(
uint32_t
ep
,
const
void
*
data
,
uint32_t
len
)
uint32_t
USBDeviceClass
::
armSend
(
uint32_t
ep
,
const
void
*
data
,
uint32_t
len
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment