mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-06 14:16:39 +08:00
close usb handle after faile (#1352)
old-commit-hash: dd05d1df835a0e7766f15fe7b9bf437988def8cb
This commit is contained in:
@@ -161,6 +161,11 @@ bool usb_connect() {
|
||||
|
||||
ignition_last = false;
|
||||
|
||||
if (dev_handle != NULL){
|
||||
libusb_close(dev_handle);
|
||||
dev_handle = NULL;
|
||||
}
|
||||
|
||||
dev_handle = libusb_open_device_with_vid_pid(ctx, 0xbbaa, 0xddcc);
|
||||
if (dev_handle == NULL) { goto fail; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user