25 lines
531 B
Rust
25 lines
531 B
Rust
// USB gadget state, cycling, and host-enumeration recovery helpers.
|
|
use anyhow::{Context, Result};
|
|
use std::{
|
|
env,
|
|
fs::{self, OpenOptions},
|
|
io::Write,
|
|
path::Path,
|
|
process::Command,
|
|
thread,
|
|
time::Duration,
|
|
};
|
|
#[cfg(not(coverage))]
|
|
use tracing::warn;
|
|
use tracing::{info, trace};
|
|
|
|
#[derive(Clone)]
|
|
pub struct UsbGadget {
|
|
udc_file: &'static str,
|
|
}
|
|
|
|
include!("gadget/sysfs_state.rs");
|
|
include!("gadget/cycle_control.rs");
|
|
include!("gadget/driver_rebind.rs");
|
|
include!("gadget/enumeration_recovery.rs");
|