Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
79f404a2
Commit
79f404a2
authored
Oct 25, 2015
by
Damien George
Browse files
stmhal: Fix USB_VCP.recv so that it returns actual amount of bytes read.
Addresses issue #1529.
parent
8e8aac89
Changes
1
Hide whitespace changes
Inline
Side-by-side
stmhal/usb.c
View file @
79f404a2
...
...
@@ -440,6 +440,7 @@ STATIC mp_obj_t pyb_usb_vcp_recv(mp_uint_t n_args, const mp_obj_t *args, mp_map_
if
(
o_ret
!=
MP_OBJ_NULL
)
{
return
mp_obj_new_int
(
ret
);
// number of bytes read into given buffer
}
else
{
vstr
.
len
=
ret
;
// set actual number of bytes read
return
mp_obj_new_str_from_vstr
(
&
mp_type_bytes
,
&
vstr
);
// create a new buffer
}
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment