Real-Time Interrupt-driven Concurrency (RTIC) framework for ARM Cortex-M microcontrollers
Find a file
Jorge Aparicio 759ac160db remove the borrow_mut method from resources
it can be used to break references rules within nested locks

``` rust
static R1: Resource<bool, C1> = unsafe { Resource::new(false) };
static R2: Resource<bool, C2> = unsafe { Resource::new(false) };
static R3: Resource<bool, C3> = unsafe { Resource::new(false) };

// Priority = 1
extern "C" fn j1(task: interrupt::Exti0Irq) {
    R1.lock(&task, |r1, c1| {
        R2.lock(&task, |r2, c2| {
            R3.lock(&task, |r3, mut c3| {
                // BAD &- and &mut - that point to the same data
                let r1_ref: &bool = R1.borrow(&c2);
                let r1_ref_mut: &mut bool = R1.borrow_mut(&mut c3);
            });
        });
    });
}
```
2017-04-07 16:38:39 -05:00
src remove the borrow_mut method from resources 2017-04-07 16:38:39 -05:00
.gitignore initial commit 2017-03-05 00:29:08 -05:00
build.rs partial thumbv6m-none-eabi support 2017-04-06 14:06:33 -05:00
Cargo.toml use stable release of the cortex-m crate 2017-03-12 11:19:43 -05:00
LICENSE-APACHE initial commit 2017-03-05 00:29:08 -05:00
LICENSE-MIT initial commit 2017-03-05 00:29:08 -05:00
README.md initial commit 2017-03-05 00:29:08 -05:00

cortex-m-srp

License

Licensed under either of

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.