-
Notifications
You must be signed in to change notification settings - Fork 2
Problems using irq in a real-world use case. #7
Comments
The data captured by the interrupt handler has to be thread-safe, which is expressed with the Is that the entire error message you got? It should normally tell you what contains the |
The full error is this:
I'll try a couple more variations on using the device peripherals ( |
Try a |
That builds, but the run result is not what I would expect:
The output is something like this:
In other words, |
Ah, now I see what you want to do. The normal rules of Rust closures apply here: You can either capture something by value, by mutable reference, or by immutable reference. Since registered handlers can interrupt each other, as well as the main loop in the scope (encoded by the Registering an interrupt handler with |
Thanks for the explanation-- that makes sense! |
I'm trying to figure out how to use this crate with interrupts, as you suggested it was useful for this case. Specifically, I'm trying to read and clear nrf52's GPIOTE interrupts. Following your example, I have:
later in my main fn I do:
I get a build error:
I think I'm missing something here. Do I need to enable:
#![feature(const_fn)]
? I'm currently using stable.Thanks for any help.
The text was updated successfully, but these errors were encountered: