From 8063882801dcdf3aa099ea512c9a73adc5cb3e79 Mon Sep 17 00:00:00 2001 From: 9names <60134748+9names@users.noreply.github.com> Date: Wed, 16 Feb 2022 22:48:52 +1100 Subject: [PATCH] Add note about #[interrupt] mut -> &mut transform Co-authored-by: Jan Niehusmann --- rp2040-hal/examples/gpio_irq_example.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/rp2040-hal/examples/gpio_irq_example.rs b/rp2040-hal/examples/gpio_irq_example.rs index f3f44e5..b3adb32 100644 --- a/rp2040-hal/examples/gpio_irq_example.rs +++ b/rp2040-hal/examples/gpio_irq_example.rs @@ -157,6 +157,7 @@ fn main() -> ! { #[interrupt] fn IO_IRQ_BANK0() { + // The `#[interrupt]` attribute covertly converts this to `&'static mut Option` static mut LED_AND_BUTTON: Option = None; // This is one-time lazy initialisation. We steal the variables given to us