micropython-lib
micropython-lib copied to clipboard
usb-device-cdc raises TypeError when using default timeout of None and going to block
https://github.com/micropython/micropython-lib/blob/master/micropython/usb/usb-device-cdc/usb/device/cdc.py#L368 and same for read function.
# check for timeout
if time.ticks_diff(time.ticks_ms(), start) >= self._timeout:
return len(buf) - len(mv)
machine.idle()
should be something like this:
if isinstance(self._timeout, int) and time.ticks_diff(time.ticks_ms(), start) >= self._timeout: