Skip to content

Commit

Permalink
Added some clarity debug
Browse files Browse the repository at this point in the history
  • Loading branch information
FrostyCoolSlug committed Aug 8, 2024
1 parent 064fdb6 commit e886a59
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion usb/src/device/tusb/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,17 @@ impl TUSBAudioGoXLR {
loop {
if Instant::now() > timeout {
// We've hit a timeout, don't infinite loop, instead throw as error.
warn!("Timeout Awaiting Response..");
return false;
}

let result = self.event_receivers.data_read.try_recv();
match result {
Ok(result) => break result,
Err(TryRecvError::Disconnected) => break false,
Err(TryRecvError::Disconnected) => {
warn!("Channel has been Disconnected");
break false;
}
Err(_) => continue,
}
}
Expand Down
1 change: 1 addition & 0 deletions usb/src/device/tusb/tusbaudio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ impl TUSBAudio<'_> {
// Register this event with the notifier..
let result = unsafe { (self.register_device_notification)(handle, u32::MAX, event, 0) };
if result != 0 {
warn!("Unable to Register Notifications");
bail!("Unable to register notifications");
}

Expand Down

0 comments on commit e886a59

Please sign in to comment.