espressif / esp-usb

Other
15 stars 9 forks source link

fix(cdc_acm): Fix closing of already closed device #13

Closed tore-espressif closed 4 months ago

tore-espressif commented 4 months ago

This bug was found out during esp-serial-flasher CDC operation.

In case the user does not track status of the CDC device and attempts to close the device from multiple places/threads the driver would crash

cc @DNedic

tore-espressif commented 4 months ago

@roma-jam Thank you for the review!

For some reason this PR contain the same changes as in feature/cdc_func_deacriptors

I rebased feature/cdc_func_descriptors on master so that is why you see 2 commits. I'll fix before merging