Skip to content

Commit

Permalink
trigger SWI when changing threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
romancardenas committed Jun 27, 2023
1 parent 4abdbc4 commit 99cde11
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions riscv-slic-macros/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 99cde11

Please sign in to comment.