refactor(usb): Split test device descriptors from mock class files

Previously, descriptors of the test devices were stored direclty in the mock
device files (e.g., "mock_[hid|msc].[h|c]"). This commit splits out the device
descriptors to separate files (e.g., "dev_[hid|msc].c") along with getter
functions.

Users that want to run the tests locally on a different device simply need to
update the "dev_[hid|msc].c" file for their device.
This commit is contained in:
Darian Leung
2024-05-08 02:56:16 +08:00
parent 94e3b83bc0
commit 6a3bb3294d
25 changed files with 1107 additions and 581 deletions

View File

@@ -330,14 +330,3 @@ uint8_t test_hcd_enum_device(hcd_pipe_handle_t default_pipe)
test_hcd_free_urb(urb);
return ENUM_ADDR;
}
void test_hcd_set_mock_msc_ep_descriptor(usb_speed_t port_speed)
{
if (port_speed == USB_SPEED_HIGH) {
mock_msc_scsi_bulk_out_ep_desc = mock_msc_scsi_bulk_out_ep_desc_hs; // HS wMaxPacketSize = 512
mock_msc_scsi_bulk_in_ep_desc = mock_msc_scsi_bulk_in_ep_desc_hs;
} else {
mock_msc_scsi_bulk_out_ep_desc = mock_msc_scsi_bulk_out_ep_desc_fs; // FS wMaxPacketSize = 64
mock_msc_scsi_bulk_in_ep_desc = mock_msc_scsi_bulk_in_ep_desc_fs;
}
}