Async-ify Driver::enable and UsbDeviceBuilder::build

This commit is contained in:
alexmoon
2022-04-06 22:10:18 -04:00
parent a1754ac8a8
commit 6abbfa9a92
8 changed files with 53 additions and 39 deletions

View File

@ -76,7 +76,7 @@ async fn main(_spawner: Spawner, p: Peripherals) {
);
// Build the builder.
let mut usb = builder.build();
let mut usb = builder.build().await;
// Run the USB device.
let usb_fut = usb.run();

View File

@ -74,7 +74,7 @@ async fn main(_spawner: Spawner, p: Peripherals) {
);
// Build the builder.
let mut usb = builder.build();
let mut usb = builder.build().await;
// Run the USB device.
let usb_fut = usb.run();

View File

@ -60,7 +60,7 @@ async fn main(_spawner: Spawner, p: Peripherals) {
let mut class = CdcAcmClass::new(&mut builder, &mut state, 64);
// Build the builder.
let mut usb = builder.build();
let mut usb = builder.build().await;
// Run the USB device.
let usb_fut = usb.run();

View File

@ -85,7 +85,7 @@ async fn main(spawner: Spawner, p: Peripherals) {
let class = CdcAcmClass::new(&mut builder, &mut res.serial_state, 64);
// Build the builder.
let usb = builder.build();
let usb = builder.build().await;
unwrap!(spawner.spawn(usb_task(usb)));
unwrap!(spawner.spawn(echo_task(class)));