aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Lilleengen <[email protected]>2024-07-31 14:34:11 +0000
committerGitHub <[email protected]>2024-07-31 14:34:11 +0000
commit91f135e25bc5241c322c61ae641eea400b3857cb (patch)
tree4dd514d24c7662fd32e5214a4b2422d608ea2405
parente89ff7d12904d030c0efe3d92623ef7a208fa5eb (diff)
parent4972dbd91b6d0b6b55d15078c1c2cc171a933678 (diff)
Merge pull request #3161 from diondokter/hsem
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()