aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsrc/bin/luchie.rs7
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];