Cortex-M Interrupt Move
It's the next best thing to moving to interrupt context.
Examples
Check out the full examples in the app-examples
folder.
The goal
The goal here is to replace usage of a mutex which may require an entire critical section, and instead model "Moving" of data to an interrupt context.
This means that we don't need a critical section to access it, we just need to be in the interrupt we moved the data to.
Here's how it works:
use ;
use wfi;
use entry;
use ;
// Define your global variables, and what
// interrupt they are allowed to be used from
// These variables are initialized at runtime
static FOO: = new_uninitialized;
static BAR: = new_uninitialized;
// These variables are const initialized. This probably isn't super useful vs just
// having a static variable inside the function, but would allow you to later send
// new data to the interrupt.
static BAZ: = new;
!
License
Licensed under either of
-
Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
-
MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.