server udc fix

This commit is contained in:
Brad Stein 2025-06-26 00:22:26 -05:00
parent a8d843fd2d
commit 7ba368bf22

View File

@ -97,10 +97,13 @@ impl UsbGadget {
/* 4 reattach + pullup */
info!("🔌 reattaching gadget to {ctrl}");
Self::write_attr(self.udc_file, &ctrl)?;
info!("Wrote udc file");
let sc = format!("/sys/class/udc/{ctrl}/soft_connect");
Self::write_attr(&sc, "0")?;
info!("Wrote soft connect file 0");
thread::sleep(Duration::from_millis(50));
Self::write_attr(&sc, "1")?;
info!("Wrote soft connect file 1");
/* 5 wait for host (but tolerate sleep) */
Self::wait_state(&ctrl, "configured", 6_000)