The PR lets users split() the USB handle. When you split the handle, you get back a USB reader and USB writer. You can use the writer to send formatted / raw data back to the USB serial host.
See the new usb_writer.rs example for more information.
use core::fmt::Write;
let mut p = bsp::Peripherals::take().unwrap();
let (mut reader, mut writer) = p.usb.split();
writeln!(writer, "Hello world! 3 + 2 = {}", 3 + 2).unwrap();
The PR lets users
split()
the USB handle. When you split the handle, you get back a USB reader and USB writer. You can use the writer to send formatted / raw data back to the USB serial host.See the new
usb_writer.rs
example for more information.