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 5, 2022
1 parent 8a2ab27 commit e1a84c7
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 @@ -204,6 +204,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 e1a84c7

Please sign in to comment.