Skip to content

Commit fb375e7

Browse files
committed
feat(support_rp2040): support specifying the USB device's product name
1 parent 0607cfa commit fb375e7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/r3_support_rp2040/src/usbstdio.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ fn with_usb_stdio_global<T>(f: impl FnOnce(&mut UsbStdioGlobal, &mut WriteBufDeq
5050

5151
pub trait Options {
5252
fn handle_input(_s: &[u8]) {}
53+
fn product_name() -> &'static str {
54+
"R3 Example Application Port"
55+
}
5356
}
5457

5558
/// Add a USB serial device to the system and register it as the destination of
@@ -77,7 +80,7 @@ pub const fn configure<System: Kernel, TOptions: Options>(b: &mut CfgBuilder<Sys
7780

7881
// Construct a `UsbDeviceBuilder` associated with `usb_bus_allocator`
7982
let usb_device = UsbDeviceBuilder::new(usb_bus_allocator, UsbVidPid(0x16c0, 0x27dd))
80-
.product("r3_support_rp2040 standard I/O")
83+
.product(TOptions::product_name())
8184
.device_class(USB_CLASS_CDC)
8285
.max_packet_size_0(64)
8386
.build();

0 commit comments

Comments
 (0)