Macro take_exception

Source
take_exception!() { /* proc-macro */ }
Expand description

Return an instance of an unnameable struct that implements ExceptionRegistration, which is bound to the exception specified by exception.

exception may be any of the variants of Exception (from cortex_m), except for Exception::HardFault

The returned struct has the following features:

  • Calling register more than once for the same Exception panics.

§Usage

use cortex_m_interrupt::take_exception;

// The value returned by `take_exception` will
// always `impl cortex_m_interrupt::ExceptionRegistration`.
let registration = take_exception!(exception);
// For example:
let registration = cortex_m_interrupt::take_exception!(SysTick);