Refactored some of the USB device (libusb wrapper) & interface code
This commit is contained in:
@@ -11,11 +11,14 @@ void AtmelIce::init() {
|
||||
// TODO: Move away from hard-coding the CMSIS-DAP/EDBG interface number
|
||||
auto& usbHidInterface = this->getEdbgInterface().getUsbHidInterface();
|
||||
usbHidInterface.setNumber(0);
|
||||
usbHidInterface.setUSBDevice(this->getLibUsbDevice());
|
||||
usbHidInterface.setVendorId(this->getVendorId());
|
||||
usbHidInterface.setProductId(this->getProductId());
|
||||
usbHidInterface.setLibUsbDevice(this->libUsbDevice);
|
||||
usbHidInterface.setLibUsbDeviceHandle(this->libUsbDeviceHandle);
|
||||
usbHidInterface.setVendorId(this->vendorId);
|
||||
usbHidInterface.setProductId(this->productId);
|
||||
|
||||
if (!usbHidInterface.isInitialised()) {
|
||||
usbHidInterface.detachKernelDriver();
|
||||
UsbDevice::setConfiguration(0);
|
||||
usbHidInterface.init();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user