diff --git a/rp2040-hal/Cargo.toml b/rp2040-hal/Cargo.toml index 1fe2f1325..170bcec78 100644 --- a/rp2040-hal/Cargo.toml +++ b/rp2040-hal/Cargo.toml @@ -28,7 +28,7 @@ rp2040-pac = { version = "0.5.0", features = ["critical-section"] } paste = "1.0" pio = "0.2.0" rp2040-hal-macros = { version = "0.1.0", path = "../rp2040-hal-macros" } -usb-device = "0.2.9" +usb-device = "0.3" vcell = "0.1" void = { version = "1.0.2", default-features = false } rand_core = "0.6.3" diff --git a/rp2040-hal/src/usb.rs b/rp2040-hal/src/usb.rs index dc5c30b4c..3a693eaa4 100644 --- a/rp2040-hal/src/usb.rs +++ b/rp2040-hal/src/usb.rs @@ -236,7 +236,8 @@ impl Inner { // Data Buffers are typically 64 bytes long as this is the max normal packet size for most FS packets. // For Isochronous endpoints a maximum buffer size of 1023 bytes is supported. // For other packet types the maximum size is 64 bytes per buffer. - if (ep_type != EndpointType::Isochronous && max_packet_size > 64) || max_packet_size > 1023 + if (!matches!(ep_type, EndpointType::Isochronous { .. }) && max_packet_size > 64) + || max_packet_size > 1023 { return Err(UsbError::Unsupported); } @@ -288,7 +289,7 @@ impl Inner { use crate::pac::usbctrl_dpram::ep_control::ENDPOINT_TYPE_A; let ep_type = match ep.ep_type { EndpointType::Bulk => ENDPOINT_TYPE_A::BULK, - EndpointType::Isochronous => ENDPOINT_TYPE_A::ISOCHRONOUS, + EndpointType::Isochronous { .. } => ENDPOINT_TYPE_A::ISOCHRONOUS, EndpointType::Control => ENDPOINT_TYPE_A::CONTROL, EndpointType::Interrupt => ENDPOINT_TYPE_A::INTERRUPT, };