Skip to content

Commit

Permalink
itm: add busy check
Browse files Browse the repository at this point in the history
  • Loading branch information
tmplt committed Jan 4, 2022
1 parent 622a9b7 commit c77e175
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/peripheral/itm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,13 @@ impl ITM {
unsafe { self.lar.write(0xC5AC_CE55) }
}

/// Indicates whether the ITM is currently processing events.
/// Returns `true` if ITM events are present and are being drained.
#[inline]
pub fn busy(&self) -> bool {
self.tcr.read().busy()
}

/// Configures the ITM with the passed [ITMSettings]. Returns `true`
/// if the configuration was successfully applied.
#[allow(clippy::missing_inline_in_public_items)]
Expand Down

0 comments on commit c77e175

Please sign in to comment.