Skip to content

Commit cf39dcf

Browse files
committed
Add high seed arg
1 parent c8baa1c commit cf39dcf

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ async fn run_async(spawner: LocalSpawner) -> Result<(), anyhow::Error> {
4444
let _sntp = EspSntp::new_default()?;
4545
log::info!("SNTP initialized");
4646

47-
let mut msc_device = MSCDevice::new(partition_label, mount_path);
47+
let mut msc_device = MSCDevice::new(partition_label, mount_path, true);
4848
msc_device.install()?;
4949

5050
let mut button = PinDriver::input(peripherals.pins.gpio14)?;

src/usb/msc_device.rs

+9-4
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ use std::ffi::CString;
1111

1212
#[derive(Default)]
1313
pub struct MSCDevice {
14-
pub partition_label: String,
15-
pub mount_path: String,
14+
partition_label: String,
15+
mount_path: String,
1616
mount_path_c_str: CString,
17+
high_speed: bool,
1718
wl_partition: Option<EspWlPartition<EspPartition>>,
1819
}
1920

@@ -34,10 +35,11 @@ unsafe extern "C" fn storage_mount_changed_cb(event: *mut tinyusb_msc_event_t) {
3435
}
3536

3637
impl MSCDevice {
37-
pub fn new(partition_label: &str, base_path: &str) -> Self {
38+
pub fn new(partition_label: &str, base_path: &str, high_speed: bool) -> Self {
3839
Self {
3940
mount_path: base_path.to_string(),
4041
partition_label: partition_label.to_string(),
42+
high_speed,
4143
..Default::default()
4244
}
4345
}
@@ -82,7 +84,10 @@ impl MSCDevice {
8284
esp!(unsafe { tinyusb_msc_storage_mount(base_path_c_str.as_ptr()) })
8385
.with_context(|| format!("Failed to mount storage at {}", self.mount_path))?;
8486

85-
let tusb_cfg = tinyusb_config_t::default();
87+
let mut tusb_cfg = tinyusb_config_t::default();
88+
if self.high_speed {
89+
// TODO:
90+
}
8691
esp!(unsafe { tinyusb_driver_install(&tusb_cfg) })
8792
.with_context(|| "Failed to install TinyUSB driver")?;
8893

0 commit comments

Comments
 (0)