Added multilock to CI

This commit is contained in:
Emil Fresk 2020-11-14 16:18:18 +01:00
parent 9cbe639ebf
commit f111c825ba
3 changed files with 9 additions and 3 deletions

View file

@ -243,6 +243,7 @@ jobs:
resource
lock
multilock
late
only-shared-access

View file

@ -0,0 +1,4 @@
Multiple single locks
Multiple single locks, s1: 1, s2: 1, s3: 1
Multilock!
Multiple single locks, s1: 2, s2: 2, s3: 2

View file

@ -9,9 +9,10 @@
use panic_semihosting as _;
#[rtic::app(device = lm3s6965, dispatchers = [GPIOA])]
#[rtic::app(device = lm3s6965)]
mod app {
use cortex_m_semihosting::{debug, hprintln};
use lm3s6965::Interrupt;
#[resources]
struct Resources {
@ -25,13 +26,13 @@ mod app {
#[init]
fn init(_: init::Context) -> init::LateResources {
locks::spawn().ok();
rtic::pend(Interrupt::GPIOA);
init::LateResources {}
}
// when omitted priority is assumed to be `1`
#[task(resources = [shared1, shared2, shared3])]
#[task(binds = GPIOA, resources = [shared1, shared2, shared3])]
fn locks(c: locks::Context) {
let mut s1 = c.resources.shared1;
let mut s2 = c.resources.shared2;