Skip to main content

interrupt

Attribute Macro interrupt 

#[interrupt]
Expand description

Marks a function as an interrupt handler. (Wrapping as a mret function)

Note that Rust has also introduced the riscv-interrupt-m and riscv-interrupt-s ABI, which are used for machine and supervisor mode interrupts, respectively. These ABIs can also be used for Qingke cores, yet they add additional register saving and restoring that is not necessary.

Usage:

ⓘ
#[interrupt]
fn UART0() { ... }

#[interrupt(core)]
fn SysTick() { ... }

// Opt out of `.highcode` (RAM) placement when the `highcode` feature is
// enabled — handler stays in flash like the rest of `.text`. No effect
// when the feature is off (everything is in flash already). Composes
// with `core`: `#[interrupt(core, lowcode)]` or `#[interrupt(lowcode, core)]`.
#[interrupt(lowcode)]
fn UART1() { ... }