Skip to content

Commit 8d0c167

Browse files
committed
Change return value of Serial_::write to be the # of bytes written
Previous 0 was always returned.
1 parent 8ef9bb3 commit 8d0c167

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cores/arduino/USB/CDC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ size_t Serial_::write(const uint8_t *buffer, size_t size)
262262
{
263263
uint32_t r = usb.send(CDC_ENDPOINT_IN, buffer, size);
264264

265-
if (r == 0) {
265+
if (r > 0) {
266266
return r;
267267
} else {
268268
setWriteError();

0 commit comments

Comments
 (0)