aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDion Dokter <[email protected]>2024-07-09 11:49:16 +0200
committerDion Dokter <[email protected]>2024-07-09 11:49:16 +0200
commit4972dbd91b6d0b6b55d15078c1c2cc171a933678 (patch)
treea4fb4201b9084867dafbab34fcffee9e90b32ed6
parent462daeeb4927416ed817423e91adb71c0861a83d (diff)
Add function to get the active HSEM interrupt
-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()