Skip to content

Commit 144c059

Browse files
authored
Merge pull request #928 from tannewt/fix_uart_timeout
Correct UART reads to return error on timeout.
2 parents ab0bc1c + ee817a2 commit 144c059

File tree

1 file changed

+5
-0
lines changed
  • ports/atmel-samd/common-hal/busio

1 file changed

+5
-0
lines changed

ports/atmel-samd/common-hal/busio/UART.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,11 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t
269269
#endif
270270
}
271271

272+
if (total_read == 0) {
273+
*errcode = EAGAIN;
274+
return MP_STREAM_ERROR;
275+
}
276+
272277
return total_read;
273278
}
274279

0 commit comments

Comments
 (0)