Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with usbd-serial 0.2.0 and above / usb-device 0.3.0 and above #213

Closed
Hecatron opened this issue Aug 1, 2024 · 1 comment

Comments

@Hecatron
Copy link
Contributor

Hecatron commented Aug 1, 2024

I'm noticing when using usbd-serial with a version of 0.2.0 or above
this seems to cause issues when creating the serial port

    let usb_bus = UsbBus::new(usb, unsafe { &mut EP_MEMORY });
    let mut serial = usbd_serial::SerialPort::new(&usb_bus);
mismatched types
`UsbBusAllocator<UsbBus<USB>>` and `UsbBusAllocator<_>` have similar names, but are actually distinct types
perhaps two different versions of crate `usb_device` are being used?rustc[Click for full compiler diagnostic](rust-analyzer-diagnostics-view:/diagnostic%20message%20%5B0%5D?0)
usb_cdc.rs(30, 22): arguments to this function are incorrect
bus.rs(149, 1): `UsbBusAllocator<UsbBus<USB>>` is defined in crate `usb_device`
bus.rs(152, 1): `UsbBusAllocator<_>` is defined in crate `usb_device`
serial_port.rs(49, 12): associated function defined here

Also when using usb-device 0.3.0 and above

    let mut usb_dev = UsbDeviceBuilder::new(&usb_bus, UsbVidPid(0x16c0, 0x27dd))
        .manufacturer("Fake company")
        .product("Serial port")
        .serial_number("TEST")
        .device_class(usbd_serial::USB_CLASS_CDC)
        .max_packet_size_0(64) // Size required for HS, and ok for FS
        .build();
mismatched types
`UsbBusAllocator<UsbBus<USB>>` and `UsbBusAllocator<_>` have similar names, but are actually distinct types
perhaps two different versions of crate `usb_device` are being used?rustcClick for full compiler diagnostic
usb_cdc.rs(32, 23): arguments to this function are incorrect
bus.rs(149, 1): `UsbBusAllocator<UsbBus<USB>>` is defined in crate `usb_device`
bus.rs(152, 1): `UsbBusAllocator<_>` is defined in crate `usb_device`
device_builder.rs(85, 12): associated function defined here
@eldruin
Copy link
Member

eldruin commented Aug 2, 2024

Fixed in #214. Thank you!

@eldruin eldruin closed this as completed Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants