From 99cde11e05f2ccae253731e0cd058715003427fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rom=C3=A1n=20C=C3=A1rdenas?= Date: Tue, 27 Jun 2023 15:27:15 +0200 Subject: [PATCH] trigger SWI when changing threshold --- riscv-slic-macros/src/api.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/riscv-slic-macros/src/api.rs b/riscv-slic-macros/src/api.rs index b9bd044..e13b7af 100644 --- a/riscv-slic-macros/src/api.rs +++ b/riscv-slic-macros/src/api.rs @@ -26,6 +26,10 @@ pub fn api_mod() -> TokenStream { pub unsafe fn __slic_set_threshold(thresh: u8) { exti_set_threshold(thresh); __SLIC.set_threshold(thresh); + // check if we need to trigger a software interrupt after changing the threshold + if __SLIC.is_ready() { + swi_set(); + } } /// Returns the interrupt priority of a given software interrupt source.