Commit d8b03377 authored by Damien George's avatar Damien George

stm32/machine_uart: Return number of bytes written even with timeout.

The errcode should be cleared so the caller sees a successful write, even
if it's a short write.
Signed-off-by: default avatarDamien George <damien@micropython.org>
parent c94a3205
......@@ -533,6 +533,7 @@ static mp_uint_t mp_machine_uart_write(mp_obj_t self_in, const void *buf_in, mp_
if (*errcode == 0 || *errcode == MP_ETIMEDOUT) {
// return number of bytes written, even if there was a timeout
*errcode = 0;
return num_tx << self->char_width;
} else {
return MP_STREAM_ERROR;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment