Skip to content

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

Open
@asdil12

Description

@asdil12

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions