Open xmos-jmccarthy opened 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.
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.
I will see if I can get it working again. If I still run into problems I can create an issue with the details.
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.