From f111c825ba3ab886a1a6bf63a0689c3d63b0f441 Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Sat, 14 Nov 2020 16:18:18 +0100 Subject: [PATCH] Added multilock to CI --- .github/workflows/build.yml | 1 + ci/expected/multilock.run | 4 ++++ examples/multilock.rs | 7 ++++--- 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 ci/expected/multilock.run diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 739c7bd9e2..e729db6775 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -243,6 +243,7 @@ jobs: resource lock + multilock late only-shared-access diff --git a/ci/expected/multilock.run b/ci/expected/multilock.run new file mode 100644 index 0000000000..10a377c5cf --- /dev/null +++ b/ci/expected/multilock.run @@ -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 diff --git a/examples/multilock.rs b/examples/multilock.rs index 99d26ad792..a6985dfa0c 100644 --- a/examples/multilock.rs +++ b/examples/multilock.rs @@ -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;