From b559b0eb54cc67d8ba8f679d5590edcdaeb1d58b Mon Sep 17 00:00:00 2001 From: Corwin Kuiper Date: Sat, 7 Aug 2021 13:10:51 +0100 Subject: [PATCH] add some docs --- agb/src/interrupt.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/agb/src/interrupt.rs b/agb/src/interrupt.rs index adab80b4..c8dc7fb0 100644 --- a/agb/src/interrupt.rs +++ b/agb/src/interrupt.rs @@ -215,6 +215,8 @@ fn get_interrupt_handle_root<'a>( } } +/// The [add_interrupt_handler!] macro should be used instead of this function. +/// Creates an interrupt handler from a closure. pub fn get_interrupt_handle( f: &(dyn Fn(Key) + Send + Sync), interrupt: Interrupt, @@ -224,6 +226,9 @@ pub fn get_interrupt_handle( get_interrupt_handle_root(f, root) } +/// The [add_interrupt_handler!] macro should be used instead of this. +/// Adds an interrupt handler to the interrupt table such that when that +/// interrupt is triggered the closure is called. pub fn add_interrupt<'a>(interrupt: Pin<&'a InterruptClosureBounded<'a>>) { let root = unsafe { &*interrupt.c.root }; root.add();