micropython-lib icon indicating copy to clipboard operation
micropython-lib copied to clipboard

usb-device-cdc raises TypeError when using default timeout of None and going to block

Open aylen384 opened this issue 9 months ago • 0 comments

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:

aylen384 avatar Mar 30 '25 14:03 aylen384