diff options
author | Brian Cully <bjc@kublai.com> | 2022-11-30 09:47:45 -0500 |
---|---|---|
committer | Brian Cully <bjc@kublai.com> | 2022-11-30 09:47:45 -0500 |
commit | fa42820dd4f5c14f5e6a8290045bb215b6fe0aa7 (patch) | |
tree | d49e2fd936dbe4920588e7e077205960b788522a /src | |
parent | e5b9d9a8a07acd095a8206cc8b51cd57771c2651 (diff) | |
download | luchie-fa42820dd4f5c14f5e6a8290045bb215b6fe0aa7.tar.gz luchie-fa42820dd4f5c14f5e6a8290045bb215b6fe0aa7.zip |
usb: skip usb interface processing until configured
Diffstat (limited to 'src')
-rwxr-xr-x | src/bin/luchie.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/bin/luchie.rs b/src/bin/luchie.rs index 9ea8e87..bbe06d4 100755 --- a/src/bin/luchie.rs +++ b/src/bin/luchie.rs @@ -166,10 +166,6 @@ fn main() -> ! { .device_class(USB_CLASS_CDC) .build(); - // while usb_dev.state() != UsbDeviceState::Configured { - // usb_dev.poll(&mut [&mut serial, &mut mouse]); - // } - logln!("💡 init led"); let mut gpiob = dp.GPIOB.split(); let mut led = gpiob.pb2.into_push_pull_output(&mut gpiob.crl); @@ -183,6 +179,9 @@ fn main() -> ! { let elapsed = sys_timer.update(); usb_dev.poll(&mut [&mut serial, &mut mouse]); + if usb_dev.state() != UsbDeviceState::Configured { + continue; + } let mut buf = [0u8; 64]; |