Skip to content

Commit

Permalink
fix: other nusb blocking api target os
Browse files Browse the repository at this point in the history
  • Loading branch information
tuna-f1sh committed Feb 12, 2025
1 parent c9df0c4 commit 41faea5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/profiler/nusb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,12 @@ impl UsbDevice {
let ret = {
// requires detech_and_claim_interface on Linux if mod is loaded
// not nice though just for profiling - maybe add a flag to claim or not?
let interface = self.handle.claim_interface(control_request.index as u8)?;
let interface = self
.handle
.claim_interface(control_request.index as u8)
.wait()?;
if clear_halt {
interface.clear_halt(0)?;
interface.clear_halt(0).wait()?;
}
interface.control_in_blocking(nusb_control, data.as_mut_slice(), self.timeout)
};
Expand Down Expand Up @@ -720,7 +723,7 @@ impl Profiler<UsbDevice> for NusbProfiler {
#[cfg(any(target_os = "linux", target_os = "android"))]
fn get_root_hubs(&mut self) -> Result<HashMap<u8, Device>> {
let mut root_hubs = HashMap::new();
for bus in nusb::list_buses()? {
for bus in nusb::list_buses().wait()? {
let device = bus.root_hub();
// get with extra data only on Linux as others _really_ don't exist
match self.build_spdevice(device, true) {
Expand Down

0 comments on commit 41faea5

Please sign in to comment.