Skip to content

Sleep vs. yield in CrazyradioThread #37

@whoenig

Description

@whoenig

We had a number of instances where it seems much better to use a short sleep rather than yield in https://github.com/bitcraze/crazyflie-link-cpp/blob/master/src/CrazyradioThread.cpp#L131-L132

I couldn't find an issue on the C++ side, i.e., the yield does not seem to cause a deadlock. However, it will issue USB requests much more rapidly.

@ataffanel For both Crazyradio PA and Crazyradio2 firmwares, is there a potential race condition between the vendor requests (to configure the radio with a different address etc.) and the send/receive endpoints?

In other words, if I send a sequence of:
libusb_control_transfer (e.g. setAddress 1)
libusb_bulk_transfer (e.g., sendPacket)
libusb_control_transfer (e.g. setAddress 2)

is it possible that the bulk_transfer uses the configuration from the second libusb_control_transfer rather than the first?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions