Skip to content

Commit dd14c34

Browse files
committed
Serial: write(buf, len) returns the number of bytes written
1 parent 3cf5b88 commit dd14c34

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cores/arduino/Serial.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ size_t UART::write(const uint8_t* c, size_t len) {
125125
while (!_serial->writeable()) {}
126126
_serial->set_blocking(true);
127127
int ret = _serial->write(c, len);
128-
return ret == -1 ? 0 : 1;
128+
return ret < 0 ? 0 : ret;
129129
}
130130

131131
void UART::block_tx(int _a) {

0 commit comments

Comments
 (0)