xmos / lib_xud

XMOS USB code and associated examples
Other
8 stars 25 forks source link

Ability to Gracefully Return / Dynamic Configuration #105

Open xmos-jmccarthy opened 3 years ago

xmos-jmccarthy commented 3 years ago

The current lib_xud requires the endpoint tables to be known at initialization and to be unchanged for the lifetime of the task. Due to this, it is impossible for an application to have multiple usb configurations and dynamically switch between them.

This could be resolved by adding functionality to gracefully close and then the app can reinitialize xud with the other configuration.

This feature is not required, but would be a nice to have.

mbruno-xmos commented 3 years ago

It appears that there are already functions to support this in the DEV/XS3 branch: XUD_CloseEndpoint() and XUD_Kill(). But we cannot figure out how to use them correctly. They seem to cause exceptions. It is unclear to me if they don't actually work or if I am just using them incorrectly.

xross commented 3 years ago

This is fairly new functionality mainly used for testing. You should be able to call XUD_Kill() followed by XUD_CloseEndpoint() however, testing is not yet present. I will raise an issue.

mbruno-xmos commented 3 years ago

I will see if I can get it working again. If I still run into problems I can create an issue with the details.