mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-11 17:41:33 +11:00
add docs
This commit is contained in:
parent
1b971b8993
commit
da6ff40a32
|
@ -242,6 +242,18 @@ pub fn add_interrupt<'a>(interrupt: Pin<&'a InterruptClosureBounded<'a>>) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
|
/// Creates a new interrupt handler in the current scope, when this scope drops
|
||||||
|
/// the interrupt handler is removed. Note that this returns nothing, but some
|
||||||
|
/// stack space is used. The interrupt handler is of the form `Fn(Key) + Send +
|
||||||
|
/// Sync` where Key can be used to unlock a mutex without checking whether
|
||||||
|
/// interrupts need to be disabled, as during an interrupt interrupts are
|
||||||
|
/// disabled.
|
||||||
|
///
|
||||||
|
/// # Usage
|
||||||
|
/// ```
|
||||||
|
/// add_interrupt_handler!(Interrupt::VBlank, |key| agb::println!("hello world!"));
|
||||||
|
/// ```
|
||||||
|
///
|
||||||
macro_rules! add_interrupt_handler {
|
macro_rules! add_interrupt_handler {
|
||||||
($interrupt: expr, $handler: expr) => {
|
($interrupt: expr, $handler: expr) => {
|
||||||
let a = $handler;
|
let a = $handler;
|
||||||
|
|
Loading…
Reference in a new issue