Moved wMaxPacketSize retrieval to Usb::UsbDevice class.

And some other bits of tidying
This commit is contained in:
Nav
2023-12-02 19:31:20 +00:00
parent eab1688b1a
commit 084eef1a30
7 changed files with 93 additions and 48 deletions

View File

@@ -21,8 +21,10 @@ namespace DebugToolDrivers::Wch::Protocols::WchLink
using Targets::RiscV::DebugModule::DmiOperation;
WchLinkInterface::WchLinkInterface(Usb::UsbInterface& usbInterface)
WchLinkInterface::WchLinkInterface(Usb::UsbInterface& usbInterface, Usb::UsbDevice& usbDevice)
: usbInterface(usbInterface)
, commandEndpointMaxPacketSize(usbDevice.getEndpointMaxPacketSize(WchLinkInterface::USB_COMMAND_ENDPOINT_OUT))
, dataEndpointMaxPacketSize(usbDevice.getEndpointMaxPacketSize(WchLinkInterface::USB_DATA_ENDPOINT_OUT))
{}
DeviceInfo WchLinkInterface::getDeviceInfo() {