Skip to content

Commit e1c8598

Browse files
committed
Merge branch 'disasm-fix-hs'
2 parents 7308cad + b8205c1 commit e1c8598

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/test_class.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,18 @@ use crate::class_prelude::*;
66
use crate::device::{UsbDevice, UsbDeviceBuilder, UsbVidPid};
77
use crate::descriptor;
88

9-
#[cfg(feature = "test-class-highspeed")]
9+
#[cfg(feature = "test-class-high-speed")]
1010
mod sizes {
11-
pub const BUFFER: usize = 1024;
11+
pub const BUFFER: usize = 2048;
12+
pub const CONTROL_ENDPOINT: u8 = 64;
1213
pub const BULK_ENDPOINT: u16 = 512;
1314
pub const INTERRUPT_ENDPOINT: u16 = 1024;
1415
}
1516

16-
#[cfg(not(feature = "test-class-highspeed"))]
17+
#[cfg(not(feature = "test-class-high-speed"))]
1718
mod sizes {
1819
pub const BUFFER: usize = 256;
20+
pub const CONTROL_ENDPOINT: u8 = 8;
1921
pub const BULK_ENDPOINT: u16 = 64;
2022
pub const INTERRUPT_ENDPOINT: u16 = 31;
2123
}
@@ -96,13 +98,16 @@ impl<B: UsbBus> TestClass<'_, B> {
9698
/// - manufacturer
9799
/// - product
98100
/// - serial number
101+
/// - max_packet_size_0
99102
///
100-
/// on the returned builder. You should not change these values.
103+
/// on the returned builder. If you change the manufacturer, product, or serial number fields,
104+
/// the test host may misbehave.
101105
pub fn make_device_builder<'a, 'b> (&'a self, usb_bus: &'b UsbBusAllocator<B>) -> UsbDeviceBuilder<'b, B> {
102106
UsbDeviceBuilder::new(&usb_bus, UsbVidPid(VID, PID))
103107
.manufacturer(MANUFACTURER)
104108
.product(PRODUCT)
105109
.serial_number(SERIAL_NUMBER)
110+
.max_packet_size_0(sizes::CONTROL_ENDPOINT)
106111
}
107112

108113
/// Must be called after polling the UsbDevice.

0 commit comments

Comments
 (0)