aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--embassy-stm32/src/hsem/mod.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/embassy-stm32/src/hsem/mod.rs b/embassy-stm32/src/hsem/mod.rs
index b77a3415b..06ab7a9bc 100644
--- a/embassy-stm32/src/hsem/mod.rs
+++ b/embassy-stm32/src/hsem/mod.rs
@@ -158,6 +158,11 @@ impl<'d, T: Instance> HardwareSemaphore<'d, T> {
158 .modify(|w| w.set_ise(sem_x, enable)); 158 .modify(|w| w.set_ise(sem_x, enable));
159 } 159 }
160 160
161 /// Gets the interrupt flag for the semaphore.
162 pub fn is_interrupt_active(&mut self, core_id: CoreId, sem_x: usize) -> bool {
163 T::regs().isr(core_id_to_index(core_id)).read().isf(sem_x)
164 }
165
161 /// Clears the interrupt flag for the semaphore. 166 /// Clears the interrupt flag for the semaphore.
162 pub fn clear_interrupt(&mut self, core_id: CoreId, sem_x: usize) { 167 pub fn clear_interrupt(&mut self, core_id: CoreId, sem_x: usize) {
163 T::regs() 168 T::regs()