Skip to content

Commit

Permalink
wip add debug print
Browse files Browse the repository at this point in the history
  • Loading branch information
alefminus committed May 24, 2022
1 parent 3b36026 commit d7403fa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions streaming/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,17 @@ impl PicoStreamingDevice {
pub fn wait_for_state_settle(&self) {
// TODO: timeout
let target_state = self.target_state.get();
let mut count = 0;
loop {
if *self.current_state.read() == target_state {
return;
}
thread::sleep(Duration::from_millis(50));
count += 1;
if count > 10 {
println!("waiting for settle: current {:?}, target {:?}",
*self.current_state.read(), target_state);
}
}
}

Expand Down

0 comments on commit d7403fa

Please sign in to comment.