Skip to content

Commit

Permalink
Merge pull request #10019 from dhalbert/usb_cdc.Serial.read-doc
Browse files Browse the repository at this point in the history
Fix usb_cdc.Serial.read() documentation
  • Loading branch information
tannewt authored Jan 31, 2025
2 parents 538818c + 6d8cca4 commit 5d39e46
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions shared-bindings/usb_cdc/Serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@
//| The available instances are in the ``usb_cdc.serials`` tuple."""
//| ...
//|
//| def read(self, size: int = 1) -> bytes:
//| """Read at most ``size`` bytes. If ``size`` exceeds the internal buffer size
//| only the bytes in the buffer will be read. If `timeout` is > 0 or ``None``,
//| and fewer than ``size`` bytes are available, keep waiting until the timeout
//| expires or ``size`` bytes are available.
//| def read(self, size: int = -1) -> bytes:
//| """Read at most ``size`` bytes. If ``size`` exceeds the internal buffer size,
//| only the bytes in the buffer will be read. If ``size`` is not specified or is ``-1``,
//| read as many bytes as possible, until the timeout expires.
//| If `timeout` is > 0 or ``None``, and fewer than ``size`` bytes are available,
//| keep waiting until the timeout expires or ``size`` bytes are available.
//|
//| If no bytes are read, return ``b''``. This is unlike, say, `busio.UART.read()`, which
//| would return ``None``.
//|
//| :return: Data read
//| :rtype: bytes"""
Expand Down

0 comments on commit 5d39e46

Please sign in to comment.