Skip to content

Commit 34ff684

Browse files
committed
itm: add busy check
1 parent 7c3173f commit 34ff684

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/peripheral/itm.rs

+7
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,13 @@ impl ITM {
196196
unsafe { self.lar.write(0xC5AC_CE55) }
197197
}
198198

199+
/// Indicates whether the ITM is currently processing events.
200+
/// Returns `true` if ITM events are present and are being drained.
201+
#[inline]
202+
pub fn busy(&self) -> bool {
203+
self.tcr.read().busy()
204+
}
205+
199206
/// Configures the ITM with the passed [ITMSettings]. Returns `true`
200207
/// if the configuration was successfully applied.
201208
pub fn configure(&mut self, settings: ITMSettings) -> Result<(), ITMConfigurationError> {

0 commit comments

Comments
 (0)