Skip to content

Commit

Permalink
add a function to retrieve the first nscope in DFU mode
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjmeyer committed Jan 7, 2024
1 parent e14a534 commit 997553e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/lab_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,16 @@ impl LabBench {
}
Err(err)
}

/// Returns the first nScope that is in DFU mode
pub fn get_first_in_dfu(&self) -> Option<NscopeLink> {
for nsl in self.list() {
if nsl.in_dfu {
return Some(nsl)
}
}
None
}
}

impl NscopeLink {
Expand Down

0 comments on commit 997553e

Please sign in to comment.