Add function to get the active HSEM interrupt

This commit is contained in:
Dion Dokter 2024-07-09 11:49:16 +02:00
parent 462daeeb49
commit 4972dbd91b

View File

@ -158,6 +158,11 @@ impl<'d, T: Instance> HardwareSemaphore<'d, T> {
.modify(|w| w.set_ise(sem_x, enable));
}
/// Gets the interrupt flag for the semaphore.
pub fn is_interrupt_active(&mut self, core_id: CoreId, sem_x: usize) -> bool {
T::regs().isr(core_id_to_index(core_id)).read().isf(sem_x)
}
/// Clears the interrupt flag for the semaphore.
pub fn clear_interrupt(&mut self, core_id: CoreId, sem_x: usize) {
T::regs()