aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to 'ui')
-rw-r--r--ui/exception-invalid.rs11
-rw-r--r--ui/exception-invalid.stderr8
-rw-r--r--ui/extern-interrupt-not-enough.rs11
-rw-r--r--ui/extern-interrupt-not-enough.stderr8
-rw-r--r--ui/extern-interrupt-used.rs11
-rw-r--r--ui/extern-interrupt-used.stderr8
-rw-r--r--ui/local-cfg-task-local-err.rs69
-rw-r--r--ui/local-cfg-task-local-err.stderr37
-rw-r--r--ui/local-err.rs83
-rw-r--r--ui/local-err.stderr60
-rw-r--r--ui/locals-cfg.rs50
-rw-r--r--ui/locals-cfg.stderr29
-rw-r--r--ui/resources-cfg.rs80
-rw-r--r--ui/resources-cfg.stderr119
-rw-r--r--ui/task-priority-too-high.rs10
15 files changed, 53 insertions, 541 deletions
diff --git a/ui/exception-invalid.rs b/ui/exception-invalid.rs
index 04d9bc75..d899443b 100644
--- a/ui/exception-invalid.rs
+++ b/ui/exception-invalid.rs
@@ -2,6 +2,17 @@
#[rtic::app(device = lm3s6965)]
mod app {
+ #[shared]
+ struct Shared {}
+
+ #[local]
+ struct Local {}
+
+ #[init]
+ fn init(cx: init::Context) -> (Shared, Local, init::Monotonics) {
+ (Shared {}, Local {}, init::Monotonics {})
+ }
+
#[task(binds = NonMaskableInt)]
fn nmi(_: nmi::Context) {}
}
diff --git a/ui/exception-invalid.stderr b/ui/exception-invalid.stderr
index 90213768..32123680 100644
--- a/ui/exception-invalid.stderr
+++ b/ui/exception-invalid.stderr
@@ -1,5 +1,5 @@
error: only exceptions with configurable priority can be used as hardware tasks
- --> $DIR/exception-invalid.rs:6:8
- |
-6 | fn nmi(_: nmi::Context) {}
- | ^^^
+ --> $DIR/exception-invalid.rs:17:8
+ |
+17 | fn nmi(_: nmi::Context) {}
+ | ^^^
diff --git a/ui/extern-interrupt-not-enough.rs b/ui/extern-interrupt-not-enough.rs
index f2624036..6e786347 100644
--- a/ui/extern-interrupt-not-enough.rs
+++ b/ui/extern-interrupt-not-enough.rs
@@ -2,6 +2,17 @@
#[rtic::app(device = lm3s6965)]
mod app {
+ #[shared]
+ struct Shared {}
+
+ #[local]
+ struct Local {}
+
+ #[init]
+ fn init(cx: init::Context) -> (Shared, Local, init::Monotonics) {
+ (Shared {}, Local {}, init::Monotonics {})
+ }
+
#[task]
fn a(_: a::Context) {}
}
diff --git a/ui/extern-interrupt-not-enough.stderr b/ui/extern-interrupt-not-enough.stderr
index 14f8fe9c..a667c588 100644
--- a/ui/extern-interrupt-not-enough.stderr
+++ b/ui/extern-interrupt-not-enough.stderr
@@ -1,5 +1,5 @@
error: not enough interrupts to dispatch all software tasks (need: 1; given: 0)
- --> $DIR/extern-interrupt-not-enough.rs:6:8
- |
-6 | fn a(_: a::Context) {}
- | ^
+ --> $DIR/extern-interrupt-not-enough.rs:17:8
+ |
+17 | fn a(_: a::Context) {}
+ | ^
diff --git a/ui/extern-interrupt-used.rs b/ui/extern-interrupt-used.rs
index 240e7363..a22b85f4 100644
--- a/ui/extern-interrupt-used.rs
+++ b/ui/extern-interrupt-used.rs
@@ -2,6 +2,17 @@
#[rtic::app(device = lm3s6965, dispatchers = [UART0])]
mod app {
+ #[shared]
+ struct Shared {}
+
+ #[local]
+ struct Local {}
+
+ #[init]
+ fn init(cx: init::Context) -> (Shared, Local, init::Monotonics) {
+ (Shared {}, Local {}, init::Monotonics {})
+ }
+
#[task(binds = UART0)]
fn a(_: a::Context) {}
}
diff --git a/ui/extern-interrupt-used.stderr b/ui/extern-interrupt-used.stderr
index b4d8d160..75657399 100644
--- a/ui/extern-interrupt-used.stderr
+++ b/ui/extern-interrupt-used.stderr
@@ -1,5 +1,5 @@
error: dispatcher interrupts can't be used as hardware tasks
- --> $DIR/extern-interrupt-used.rs:5:20
- |
-5 | #[task(binds = UART0)]
- | ^^^^^
+ --> $DIR/extern-interrupt-used.rs:16:20
+ |
+16 | #[task(binds = UART0)]
+ | ^^^^^
diff --git a/ui/local-cfg-task-local-err.rs b/ui/local-cfg-task-local-err.rs
deleted file mode 100644
index d4752edf..00000000
--- a/ui/local-cfg-task-local-err.rs
+++ /dev/null
@@ -1,69 +0,0 @@
-//! examples/local-cfg-task-local.rs
-
-#![deny(unsafe_code)]
-//#![deny(warnings)]
-#![no_main]
-#![no_std]
-
-use cortex_m_semihosting::debug;
-use cortex_m_semihosting::hprintln;
-use lm3s6965::Interrupt;
-use panic_semihosting as _;
-
-#[rtic::app(device = lm3s6965)]
-mod app {
- #[resources]
- struct Resources {
- // A local (move), early resource
- #[cfg(feature = "feature_l1")]
- #[task_local]
- #[init(1)]
- l1: u32,
-
- // A local (move), late resource
- #[task_local]
- l2: u32,
- }
-
- #[init]
- fn init(_: init::Context) -> (init::LateResources, init::Monotonics) {
- rtic::pend(Interrupt::UART0);
- rtic::pend(Interrupt::UART1);
- (
- init::LateResources {
- #[cfg(feature = "feature_l2")]
- l2: 2,
- #[cfg(not(feature = "feature_l2"))]
- l2: 5,
- },
- init::Monotonics(),
- )
- }
-
- // l1 ok (task_local)
- #[idle(resources =[#[cfg(feature = "feature_l1")]l1])]
- fn idle(_cx: idle::Context) -> ! {
- #[cfg(feature = "feature_l1")]
- hprintln!("IDLE:l1 = {}", _cx.resources.l1).unwrap();
- debug::exit(debug::EXIT_SUCCESS);
- loop {}
- }
-
- // l2 ok (task_local)
- #[task(priority = 1, binds = UART0, resources = [
- #[cfg(feature = "feature_l2")]l2,
- ])]
- fn uart0(_cx: uart0::Context) {
- #[cfg(feature = "feature_l2")]
- hprintln!("UART0:l2 = {}", _cx.resources.l2).unwrap();
- }
-
- // l2 error, conflicting with uart0 for l2 (task_local)
- #[task(priority = 1, binds = UART1, resources = [
- #[cfg(not(feature = "feature_l2"))]l2
- ])]
- fn uart1(_cx: uart1::Context) {
- #[cfg(not(feature = "feature_l2"))]
- hprintln!("UART0:l2 = {}", _cx.resources.l2).unwrap();
- }
-}
diff --git a/ui/local-cfg-task-local-err.stderr b/ui/local-cfg-task-local-err.stderr
deleted file mode 100644
index 73dfaeb6..00000000
--- a/ui/local-cfg-task-local-err.stderr
+++ /dev/null
@@ -1,37 +0,0 @@
-error: task local resource "l2" is used by multiple tasks
- --> $DIR/local-cfg-task-local-err.rs:25:9
- |
-25 | l2: u32,
- | ^^
-
-error: task local resource "l2" is used by task "uart0" with priority 1
- --> $DIR/local-cfg-task-local-err.rs:54:39
- |
-54 | #[cfg(feature = "feature_l2")]l2,
- | ^^
-
-error: task local resource "l2" is used by task "uart1" with priority 1
- --> $DIR/local-cfg-task-local-err.rs:63:44
- |
-63 | #[cfg(not(feature = "feature_l2"))]l2
- | ^^
-
-warning: unused import: `cortex_m_semihosting::debug`
- --> $DIR/local-cfg-task-local-err.rs:8:5
- |
-8 | use cortex_m_semihosting::debug;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(unused_imports)]` on by default
-
-warning: unused import: `cortex_m_semihosting::hprintln`
- --> $DIR/local-cfg-task-local-err.rs:9:5
- |
-9 | use cortex_m_semihosting::hprintln;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused import: `lm3s6965::Interrupt`
- --> $DIR/local-cfg-task-local-err.rs:10:5
- |
-10 | use lm3s6965::Interrupt;
- | ^^^^^^^^^^^^^^^^^^^
diff --git a/ui/local-err.rs b/ui/local-err.rs
deleted file mode 100644
index 7ebfc069..00000000
--- a/ui/local-err.rs
+++ /dev/null
@@ -1,83 +0,0 @@
-//! examples/local_err.rs
-
-#![deny(unsafe_code)]
-#![deny(warnings)]
-#![no_main]
-#![no_std]
-
-// errors here, since we cannot bail compilation or generate stubs
-// run cargo expand, then you see the root of the problem...
-use cortex_m_semihosting::{debug, hprintln};
-use lm3s6965::Interrupt;
-use panic_semihosting as _;
-
-#[rtic::app(device = lm3s6965)]
-mod app {
- #[resources]
- struct Resources {
- // An early resource
- #[init(0)]
- shared: u32,
-
- // A local (move), early resource
- #[task_local]
- #[init(1)]
- l1: u32,
-
- // An exclusive, early resource
- #[lock_free]
- #[init(1)]
- e1: u32,
-
- // A local (move), late resource
- #[task_local]
- l2: u32,
-
- // An exclusive, late resource
- #[lock_free]
- e2: u32,
- }
-
- #[init]
- fn init(_: init::Context) -> (init::LateResources, init::Monotonics) {
- rtic::pend(Interrupt::UART0);
- rtic::pend(Interrupt::UART1);
- (init::LateResources { e2: 2, l2: 2 }, init::Monotonics())
- }
-
- // `shared` cannot be accessed from this context
- // l1 ok
- // l2 rejeceted (not task_local)
- // e2 ok
- #[idle(resources =[l1, l2, e2])]
- fn idle(cx: idle::Context) -> ! {
- hprintln!("IDLE:l1 = {}", cx.resources.l1).unwrap();
- hprintln!("IDLE:e2 = {}", cx.resources.e2).unwrap();
- debug::exit(debug::EXIT_SUCCESS);
- loop {}
- }
-
- // `shared` can be accessed from this context
- // l2 rejected (not task_local)
- // e1 rejected (not lock_free)
- #[task(priority = 1, binds = UART0, resources = [shared, l2, e1])]
- fn uart0(cx: uart0::Context) {
- let shared: &mut u32 = cx.resources.shared;
- *shared += 1;
- *cx.resources.e1 += 10;
- hprintln!("UART0: shared = {}", shared).unwrap();
- hprintln!("UART0:l2 = {}", cx.resources.l2).unwrap();
- hprintln!("UART0:e1 = {}", cx.resources.e1).unwrap();
- }
-
- // l2 rejected (not task_local)
- #[task(priority = 2, binds = UART1, resources = [shared, l2, e1])]
- fn uart1(cx: uart1::Context) {
- let shared: &mut u32 = cx.resources.shared;
- *shared += 1;
-
- hprintln!("UART1: shared = {}", shared).unwrap();
- hprintln!("UART1:l2 = {}", cx.resources.l2).unwrap();
- hprintln!("UART1:e1 = {}", cx.resources.e1).unwrap();
- }
-}
diff --git a/ui/local-err.stderr b/ui/local-err.stderr
deleted file mode 100644
index 88369d8e..00000000
--- a/ui/local-err.stderr
+++ /dev/null
@@ -1,60 +0,0 @@
-error: task local resource "l2" is used by multiple tasks
- --> $DIR/local-err.rs:34:9
- |
-34 | l2: u32,
- | ^^
-
-error: task local resource "l2" is used by task "idle" with priority 0
- --> $DIR/local-err.rs:52:28
- |
-52 | #[idle(resources =[l1, l2, e2])]
- | ^^
-
-error: task local resource "l2" is used by task "uart0" with priority 1
- --> $DIR/local-err.rs:63:62
- |
-63 | #[task(priority = 1, binds = UART0, resources = [shared, l2, e1])]
- | ^^
-
-error: task local resource "l2" is used by task "uart1" with priority 2
- --> $DIR/local-err.rs:74:62
- |
-74 | #[task(priority = 2, binds = UART1, resources = [shared, l2, e1])]
- | ^^
-
-error: Lock free resource "e1" is used by tasks at different priorities
- --> $DIR/local-err.rs:30:9
- |
-30 | e1: u32,
- | ^^
-
-error: Resource "e1" is declared lock free but used by tasks at different priorities
- --> $DIR/local-err.rs:63:66
- |
-63 | #[task(priority = 1, binds = UART0, resources = [shared, l2, e1])]
- | ^^
-
-error: Resource "e1" is declared lock free but used by tasks at different priorities
- --> $DIR/local-err.rs:74:66
- |
-74 | #[task(priority = 2, binds = UART1, resources = [shared, l2, e1])]
- | ^^
-
-error: unused imports: `debug`, `hprintln`
- --> $DIR/local-err.rs:10:28
- |
-10 | use cortex_m_semihosting::{debug, hprintln};
- | ^^^^^ ^^^^^^^^
- |
-note: the lint level is defined here
- --> $DIR/local-err.rs:4:9
- |
-4 | #![deny(warnings)]
- | ^^^^^^^^
- = note: `#[deny(unused_imports)]` implied by `#[deny(warnings)]`
-
-error: unused import: `lm3s6965::Interrupt`
- --> $DIR/local-err.rs:11:5
- |
-11 | use lm3s6965::Interrupt;
- | ^^^^^^^^^^^^^^^^^^^
diff --git a/ui/locals-cfg.rs b/ui/locals-cfg.rs
deleted file mode 100644
index 170d3026..00000000
--- a/ui/locals-cfg.rs
+++ /dev/null
@@ -1,50 +0,0 @@
-#![no_main]
-
-use panic_semihosting as _;
-
-#[rtic::app(device = lm3s6965, dispatchers = [SSI0])]
-mod app {
- #[init]
- fn init(_: init::Context) -> (init::LateResources, init::Monotonics) {
- #[cfg(never)]
- static mut FOO: u32 = 0;
-
- FOO;
-
- (init::LateResources {}, init::Monotonics())
- }
-
- #[idle]
- fn idle(_: idle::Context) -> ! {
- #[cfg(never)]
- static mut FOO: u32 = 0;
-
- FOO;
-
- loop {}
- }
-
- #[task(binds = SVCall)]
- fn svcall(_: svcall::Context) {
- #[cfg(never)]
- static mut FOO: u32 = 0;
-
- FOO;
- }
-
- #[task(binds = UART0)]
- fn uart0(_: uart0::Context) {
- #[cfg(never)]
- static mut FOO: u32 = 0;
-
- FOO;
- }
-
- #[task]
- fn foo(_: foo::Context) {
- #[cfg(never)]
- static mut FOO: u32 = 0;
-
- FOO;
- }
-}
diff --git a/ui/locals-cfg.stderr b/ui/locals-cfg.stderr
deleted file mode 100644
index 33a80754..00000000
--- a/ui/locals-cfg.stderr
+++ /dev/null
@@ -1,29 +0,0 @@
-error[E0425]: cannot find value `FOO` in this scope
- --> $DIR/locals-cfg.rs:12:9
- |
-12 | FOO;
- | ^^^ not found in this scope
-
-error[E0425]: cannot find value `FOO` in this scope
- --> $DIR/locals-cfg.rs:22:9
- |
-22 | FOO;
- | ^^^ not found in this scope
-
-error[E0425]: cannot find value `FOO` in this scope
- --> $DIR/locals-cfg.rs:32:9
- |
-32 | FOO;
- | ^^^ not found in this scope
-
-error[E0425]: cannot find value `FOO` in this scope
- --> $DIR/locals-cfg.rs:40:9
- |
-40 | FOO;
- | ^^^ not found in this scope
-
-error[E0425]: cannot find value `FOO` in this scope
- --> $DIR/locals-cfg.rs:48:9
- |
-48 | FOO;
- | ^^^ not found in this scope
diff --git a/ui/resources-cfg.rs b/ui/resources-cfg.rs
deleted file mode 100644
index c802a46f..00000000
--- a/ui/resources-cfg.rs
+++ /dev/null
@@ -1,80 +0,0 @@
-#![no_main]
-
-use panic_semihosting as _;
-
-#[rtic::app(device = lm3s6965)]
-mod app {
- #[resources]
- struct Resources {
- #[cfg(never)]
- #[init(0)]
- o1: u32, // init
-
- #[cfg(never)]
- #[init(0)]
- o2: u32, // idle
-
- #[cfg(never)]
- #[init(0)]
- o3: u32, // EXTI0
-
- #[cfg(never)]
- #[init(0)]
- o4: u32, // idle
-
- #[cfg(never)]
- #[init(0)]
- o5: u32, // EXTI1
-
- #[cfg(never)]
- #[init(0)]
- o6: u32, // init
-
- #[cfg(never)]
- #[init(0)]
- s1: u32, // idle & EXTI0
-
- #[cfg(never)]
- #[init(0)]
- s2: u32, // EXTI0 & EXTI1
-
- #[cfg(never)]
- #[init(0)]
- s3: u32,
- }
-
- #[init(resources = [o1, o4, o5, o6, s3])]
- fn init(c: init::Context) -> (init::LateResources, init::Monotonics) {
- c.resources.o1;
- c.resources.o4;
- c.resources.o5;
- c.resources.o6;
- c.resources.s3;
-
- (init::LateResources {}, init::Monotonics())
- }
-
- #[idle(resources = [o2, &o4, s1, &s3])]
- fn idle(c: idle::Context) -> ! {
- c.resources.o2;
- c.resources.o4;
- c.resources.s1;
- c.resources.s3;
-
- loop {}
- }
-
- #[task(binds = UART0, resources = [o3, s1, s2, &s3])]
- fn uart0(c: uart0::Context) {
- c.resources.o3;
- c.resources.s1;
- c.resources.s2;
- c.resources.s3;
- }
-
- #[task(binds = UART1, resources = [s2, &o5])]
- fn uart1(c: uart1::Context) {
- c.resources.s2;
- c.resources.o5;
- }
-}
diff --git a/ui/resources-cfg.stderr b/ui/resources-cfg.stderr
deleted file mode 100644
index 03612de0..00000000
--- a/ui/resources-cfg.stderr
+++ /dev/null
@@ -1,119 +0,0 @@
-error[E0609]: no field `o1` on type `__rtic_internal_initResources<'_>`
- --> $DIR/resources-cfg.rs:48:21
- |
-48 | c.resources.o1;
- | ^^ unknown field
- |
- = note: available fields are: `__marker__`
-
-error[E0609]: no field `o4` on type `__rtic_internal_initResources<'_>`
- --> $DIR/resources-cfg.rs:49:21
- |
-49 | c.resources.o4;
- | ^^ unknown field
- |
- = note: available fields are: `__marker__`
-
-error[E0609]: no field `o5` on type `__rtic_internal_initResources<'_>`
- --> $DIR/resources-cfg.rs:50:21
- |
-50 | c.resources.o5;
- | ^^ unknown field
- |
- = note: available fields are: `__marker__`
-
-error[E0609]: no field `o6` on type `__rtic_internal_initResources<'_>`
- --> $DIR/resources-cfg.rs:51:21
- |
-51 | c.resources.o6;
- | ^^ unknown field
- |
- = note: available fields are: `__marker__`
-
-error[E0609]: no field `s3` on type `__rtic_internal_initResources<'_>`
- --> $DIR/resources-cfg.rs:52:21
- |
-52 | c.resources.s3;
- | ^^ unknown field
- |
- = note: available fields are: `__marker__`
-
-error[E0609]: no field `o2` on type `__rtic_internal_idleResources<'_>`
- --> $DIR/resources-cfg.rs:59:21
- |
-59 | c.resources.o2;
- | ^^ unknown field
- |
- = note: available fields are: `__marker__`
-
-error[E0609]: no field `o4` on type `__rtic_internal_idleResources<'_>`
- --> $DIR/resources-cfg.rs:60:21
- |
-60 | c.resources.o4;
- | ^^ unknown field
- |
- = note: available fields are: `__marker__`
-
-error[E0609]: no field `s1` on type `__rtic_internal_idleResources<'_>`
- --> $DIR/resources-cfg.rs:61:21
- |
-61 | c.resources.s1;
- | ^^ unknown field
- |
- = note: available fields are: `__marker__`
-
-error[E0609]: no field `s3` on type `__rtic_internal_idleResources<'_>`
- --> $DIR/resources-cfg.rs:62:21
- |
-62 | c.resources.s3;
- | ^^ unknown field
- |
- = note: available fields are: `__marker__`
-
-error[E0609]: no field `o3` on type `__rtic_internal_uart0Resources<'_>`
- --> $DIR/resources-cfg.rs:69:21
- |
-69 | c.resources.o3;
- | ^^ unknown field
- |
- = note: available fields are: `__marker__`
-
-error[E0609]: no field `s1` on type `__rtic_internal_uart0Resources<'_>`
- --> $DIR/resources-cfg.rs:70:21
- |
-70 | c.resources.s1;
- | ^^ unknown field
- |
- = note: available fields are: `__marker__`
-
-error[E0609]: no field `s2` on type `__rtic_internal_uart0Resources<'_>`
- --> $DIR/resources-cfg.rs:71:21
- |
-71 | c.resources.s2;
- | ^^ unknown field
- |
- = note: available fields are: `__marker__`
-
-error[E0609]: no field `s3` on type `__rtic_internal_uart0Resources<'_>`
- --> $DIR/resources-cfg.rs:72:21
- |
-72 | c.resources.s3;
- | ^^ unknown field
- |
- = note: available fields are: `__marker__`
-
-error[E0609]: no field `s2` on type `__rtic_internal_uart1Resources<'_>`
- --> $DIR/resources-cfg.rs:77:21
- |
-77 | c.resources.s2;
- | ^^ unknown field
- |
- = note: available fields are: `__marker__`
-
-error[E0609]: no field `o5` on type `__rtic_internal_uart1Resources<'_>`
- --> $DIR/resources-cfg.rs:78:21
- |
-78 | c.resources.o5;
- | ^^ unknown field
- |
- = note: available fields are: `__marker__`
diff --git a/ui/task-priority-too-high.rs b/ui/task-priority-too-high.rs
index b1cbfa94..0d903d3a 100644
--- a/ui/task-priority-too-high.rs
+++ b/ui/task-priority-too-high.rs
@@ -2,9 +2,15 @@
#[rtic::app(device = lm3s6965)]
mod app {
+ #[shared]
+ struct Shared {}
+
+ #[local]
+ struct Local {}
+
#[init]
- fn init(_: init::Context) -> (init::LateResources, init::Monotonics) {
- (init::LateResources {}, init::Monotonics())
+ fn init(cx: init::Context) -> (Shared, Local, init::Monotonics) {
+ (Shared {}, Local {}, init::Monotonics {})
}
#[task(binds = GPIOA, priority = 1)]