aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to 'ui')
-rw-r--r--ui/single/exception-invalid.rs7
-rw-r--r--ui/single/exception-invalid.stderr5
-rw-r--r--ui/single/exception-systick-used.rs10
-rw-r--r--ui/single/exception-systick-used.stderr5
-rw-r--r--ui/single/extern-interrupt-not-enough.rs7
-rw-r--r--ui/single/extern-interrupt-not-enough.stderr5
-rw-r--r--ui/single/extern-interrupt-used.rs11
-rw-r--r--ui/single/extern-interrupt-used.stderr5
-rw-r--r--ui/single/locals-cfg.rs53
-rw-r--r--ui/single/locals-cfg.stderr41
-rw-r--r--ui/single/resources-cfg.rs79
-rw-r--r--ui/single/resources-cfg.stderr125
-rw-r--r--ui/single/task-priority-too-high.rs38
-rw-r--r--ui/single/task-priority-too-high.stderr7
14 files changed, 398 insertions, 0 deletions
diff --git a/ui/single/exception-invalid.rs b/ui/single/exception-invalid.rs
new file mode 100644
index 00000000..04d9bc75
--- /dev/null
+++ b/ui/single/exception-invalid.rs
@@ -0,0 +1,7 @@
+#![no_main]
+
+#[rtic::app(device = lm3s6965)]
+mod app {
+ #[task(binds = NonMaskableInt)]
+ fn nmi(_: nmi::Context) {}
+}
diff --git a/ui/single/exception-invalid.stderr b/ui/single/exception-invalid.stderr
new file mode 100644
index 00000000..90213768
--- /dev/null
+++ b/ui/single/exception-invalid.stderr
@@ -0,0 +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) {}
+ | ^^^
diff --git a/ui/single/exception-systick-used.rs b/ui/single/exception-systick-used.rs
new file mode 100644
index 00000000..1c30b700
--- /dev/null
+++ b/ui/single/exception-systick-used.rs
@@ -0,0 +1,10 @@
+#![no_main]
+
+#[rtic::app(device = lm3s6965)]
+mod app {
+ #[task(binds = SysTick)]
+ fn sys_tick(_: sys_tick::Context) {}
+
+ #[task(schedule = [foo])]
+ fn foo(_: foo::Context) {}
+}
diff --git a/ui/single/exception-systick-used.stderr b/ui/single/exception-systick-used.stderr
new file mode 100644
index 00000000..23b6dc4a
--- /dev/null
+++ b/ui/single/exception-systick-used.stderr
@@ -0,0 +1,5 @@
+error: this exception can't be used because it's being used by the runtime
+ --> $DIR/exception-systick-used.rs:6:8
+ |
+6 | fn sys_tick(_: sys_tick::Context) {}
+ | ^^^^^^^^
diff --git a/ui/single/extern-interrupt-not-enough.rs b/ui/single/extern-interrupt-not-enough.rs
new file mode 100644
index 00000000..f2624036
--- /dev/null
+++ b/ui/single/extern-interrupt-not-enough.rs
@@ -0,0 +1,7 @@
+#![no_main]
+
+#[rtic::app(device = lm3s6965)]
+mod app {
+ #[task]
+ fn a(_: a::Context) {}
+}
diff --git a/ui/single/extern-interrupt-not-enough.stderr b/ui/single/extern-interrupt-not-enough.stderr
new file mode 100644
index 00000000..73ce7ad0
--- /dev/null
+++ b/ui/single/extern-interrupt-not-enough.stderr
@@ -0,0 +1,5 @@
+error: not enough `extern` interrupts to dispatch all software tasks (need: 1; given: 0)
+ --> $DIR/extern-interrupt-not-enough.rs:6:8
+ |
+6 | fn a(_: a::Context) {}
+ | ^
diff --git a/ui/single/extern-interrupt-used.rs b/ui/single/extern-interrupt-used.rs
new file mode 100644
index 00000000..89c23784
--- /dev/null
+++ b/ui/single/extern-interrupt-used.rs
@@ -0,0 +1,11 @@
+#![no_main]
+
+#[rtic::app(device = lm3s6965)]
+mod app {
+ #[task(binds = UART0)]
+ fn a(_: a::Context) {}
+
+ extern "C" {
+ fn UART0();
+ }
+}
diff --git a/ui/single/extern-interrupt-used.stderr b/ui/single/extern-interrupt-used.stderr
new file mode 100644
index 00000000..fb0ff5bc
--- /dev/null
+++ b/ui/single/extern-interrupt-used.stderr
@@ -0,0 +1,5 @@
+error: `extern` interrupts can't be used as hardware tasks
+ --> $DIR/extern-interrupt-used.rs:5:20
+ |
+5 | #[task(binds = UART0)]
+ | ^^^^^
diff --git a/ui/single/locals-cfg.rs b/ui/single/locals-cfg.rs
new file mode 100644
index 00000000..45a7a911
--- /dev/null
+++ b/ui/single/locals-cfg.rs
@@ -0,0 +1,53 @@
+#![no_main]
+use panic_halt as _;
+
+#[rtic::app(device = lm3s6965)]
+mod app {
+ #[init]
+ fn init(_: init::Context) -> init::LateResources {
+ #[cfg(never)]
+ static mut FOO: u32 = 0;
+
+ FOO;
+
+ init::LateResources {}
+ }
+
+ #[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;
+ }
+
+ extern "C" {
+ fn UART1();
+ }
+}
diff --git a/ui/single/locals-cfg.stderr b/ui/single/locals-cfg.stderr
new file mode 100644
index 00000000..e58bd935
--- /dev/null
+++ b/ui/single/locals-cfg.stderr
@@ -0,0 +1,41 @@
+error[E0425]: cannot find value `FOO` in this scope
+ --> $DIR/locals-cfg.rs:11:9
+ |
+11 | FOO;
+ | ^^^ not found in this scope
+
+error[E0425]: cannot find value `FOO` in this scope
+ --> $DIR/locals-cfg.rs:21:9
+ |
+21 | FOO;
+ | ^^^ not found in this scope
+
+error[E0425]: cannot find value `FOO` in this scope
+ --> $DIR/locals-cfg.rs:31:9
+ |
+31 | FOO;
+ | ^^^ not found in this scope
+
+error[E0425]: cannot find value `FOO` in this scope
+ --> $DIR/locals-cfg.rs:39:9
+ |
+39 | FOO;
+ | ^^^ not found in this scope
+
+error[E0425]: cannot find value `FOO` in this scope
+ --> $DIR/locals-cfg.rs:47:9
+ |
+47 | FOO;
+ | ^^^ not found in this scope
+
+error: duplicate lang item in crate `panic_halt` (which `$CRATE` depends on): `panic_impl`.
+ |
+ = note: the lang item is first defined in crate `std` (which `$CRATE` depends on)
+ = note: first definition in `std` loaded from /usr/share/rust/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-cf0f33af3a901778.rlib
+ = note: second definition in `panic_halt` loaded from $DIR/target/tests/target/x86_64-unknown-linux-gnu/debug/deps/libpanic_halt-ba6f0ab3439cbc7e.rmeta
+
+error: duplicate lang item in crate `panic_semihosting`: `panic_impl`.
+ |
+ = note: the lang item is first defined in crate `panic_halt` (which `$CRATE` depends on)
+ = note: first definition in `panic_halt` loaded from $DIR/target/tests/target/x86_64-unknown-linux-gnu/debug/deps/libpanic_halt-ba6f0ab3439cbc7e.rmeta
+ = note: second definition in `panic_semihosting` loaded from $DIR/target/tests/target/x86_64-unknown-linux-gnu/debug/deps/libpanic_semihosting-805015f4a2d05965.rmeta
diff --git a/ui/single/resources-cfg.rs b/ui/single/resources-cfg.rs
new file mode 100644
index 00000000..2ba65a04
--- /dev/null
+++ b/ui/single/resources-cfg.rs
@@ -0,0 +1,79 @@
+#![no_main]
+use panic_halt 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 {
+ c.resources.o1;
+ c.resources.o4;
+ c.resources.o5;
+ c.resources.o6;
+ c.resources.s3;
+
+ init::LateResources {}
+ }
+
+ #[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/single/resources-cfg.stderr b/ui/single/resources-cfg.stderr
new file mode 100644
index 00000000..17f08d81
--- /dev/null
+++ b/ui/single/resources-cfg.stderr
@@ -0,0 +1,125 @@
+error: duplicate lang item in crate `panic_halt` (which `$CRATE` depends on): `panic_impl`.
+ |
+ = note: the lang item is first defined in crate `std` (which `$CRATE` depends on)
+ = note: first definition in `std` loaded from /usr/share/rust/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-cf0f33af3a901778.rlib
+ = note: second definition in `panic_halt` loaded from $DIR/target/tests/target/x86_64-unknown-linux-gnu/debug/deps/libpanic_halt-ba6f0ab3439cbc7e.rmeta
+
+error[E0609]: no field `o1` on type `initResources<'_>`
+ --> $DIR/resources-cfg.rs:47:21
+ |
+47 | c.resources.o1;
+ | ^^ unknown field
+ |
+ = note: available fields are: `__marker__`
+
+error[E0609]: no field `o4` on type `initResources<'_>`
+ --> $DIR/resources-cfg.rs:48:21
+ |
+48 | c.resources.o4;
+ | ^^ unknown field
+ |
+ = note: available fields are: `__marker__`
+
+error[E0609]: no field `o5` on type `initResources<'_>`
+ --> $DIR/resources-cfg.rs:49:21
+ |
+49 | c.resources.o5;
+ | ^^ unknown field
+ |
+ = note: available fields are: `__marker__`
+
+error[E0609]: no field `o6` on type `initResources<'_>`
+ --> $DIR/resources-cfg.rs:50:21
+ |
+50 | c.resources.o6;
+ | ^^ unknown field
+ |
+ = note: available fields are: `__marker__`
+
+error[E0609]: no field `s3` on type `initResources<'_>`
+ --> $DIR/resources-cfg.rs:51:21
+ |
+51 | c.resources.s3;
+ | ^^ unknown field
+ |
+ = note: available fields are: `__marker__`
+
+error[E0609]: no field `o2` on type `idleResources<'_>`
+ --> $DIR/resources-cfg.rs:58:21
+ |
+58 | c.resources.o2;
+ | ^^ unknown field
+ |
+ = note: available fields are: `__marker__`
+
+error[E0609]: no field `o4` on type `idleResources<'_>`
+ --> $DIR/resources-cfg.rs:59:21
+ |
+59 | c.resources.o4;
+ | ^^ unknown field
+ |
+ = note: available fields are: `__marker__`
+
+error[E0609]: no field `s1` on type `idleResources<'_>`
+ --> $DIR/resources-cfg.rs:60:21
+ |
+60 | c.resources.s1;
+ | ^^ unknown field
+ |
+ = note: available fields are: `__marker__`
+
+error[E0609]: no field `s3` on type `idleResources<'_>`
+ --> $DIR/resources-cfg.rs:61:21
+ |
+61 | c.resources.s3;
+ | ^^ unknown field
+ |
+ = note: available fields are: `__marker__`
+
+error[E0609]: no field `o3` on type `uart0Resources<'_>`
+ --> $DIR/resources-cfg.rs:68:21
+ |
+68 | c.resources.o3;
+ | ^^ unknown field
+ |
+ = note: available fields are: `__marker__`
+
+error[E0609]: no field `s1` on type `uart0Resources<'_>`
+ --> $DIR/resources-cfg.rs:69:21
+ |
+69 | c.resources.s1;
+ | ^^ unknown field
+ |
+ = note: available fields are: `__marker__`
+
+error[E0609]: no field `s2` on type `uart0Resources<'_>`
+ --> $DIR/resources-cfg.rs:70:21
+ |
+70 | c.resources.s2;
+ | ^^ unknown field
+ |
+ = note: available fields are: `__marker__`
+
+error[E0609]: no field `s3` on type `uart0Resources<'_>`
+ --> $DIR/resources-cfg.rs:71:21
+ |
+71 | c.resources.s3;
+ | ^^ unknown field
+ |
+ = note: available fields are: `__marker__`
+
+error[E0609]: no field `s2` on type `uart1Resources<'_>`
+ --> $DIR/resources-cfg.rs:76:21
+ |
+76 | c.resources.s2;
+ | ^^ unknown field
+ |
+ = note: available fields are: `__marker__`
+
+error[E0609]: no field `o5` on type `uart1Resources<'_>`
+ --> $DIR/resources-cfg.rs:77:21
+ |
+77 | c.resources.o5;
+ | ^^ unknown field
+ |
+ = note: available fields are: `__marker__`
diff --git a/ui/single/task-priority-too-high.rs b/ui/single/task-priority-too-high.rs
new file mode 100644
index 00000000..caa7b8ee
--- /dev/null
+++ b/ui/single/task-priority-too-high.rs
@@ -0,0 +1,38 @@
+#![no_main]
+
+#[rtic::app(device = lm3s6965)]
+mod app {
+ #[init]
+ fn init(_: init::Context) -> init::LateResources {
+ init::LateResources {}
+ }
+
+ #[task(binds = GPIOA, priority = 1)]
+ fn gpioa(_: gpioa::Context) {}
+
+ #[task(binds = GPIOB, priority = 2)]
+ fn gpiob(_: gpiob::Context) {}
+
+ #[task(binds = GPIOC, priority = 3)]
+ fn gpioc(_: gpioc::Context) {}
+
+ #[task(binds = GPIOD, priority = 4)]
+ fn gpiod(_: gpiod::Context) {}
+
+ #[task(binds = GPIOE, priority = 5)]
+ fn gpioe(_: gpioe::Context) {}
+
+ #[task(binds = UART0, priority = 6)]
+ fn uart0(_: uart0::Context) {}
+
+ #[task(binds = UART1, priority = 7)]
+ fn uart1(_: uart1::Context) {}
+
+ // OK, this is the maximum priority supported by the device
+ #[task(binds = SSI0, priority = 8)]
+ fn ssi0(_: ssi0::Context) {}
+
+ // this value is too high!
+ #[task(binds = I2C0, priority = 9)]
+ fn i2c0(_: i2c0::Context) {}
+}
diff --git a/ui/single/task-priority-too-high.stderr b/ui/single/task-priority-too-high.stderr
new file mode 100644
index 00000000..e84ddd3c
--- /dev/null
+++ b/ui/single/task-priority-too-high.stderr
@@ -0,0 +1,7 @@
+error[E0080]: evaluation of constant value failed
+ --> $DIR/task-priority-too-high.rs:3:1
+ |
+3 | #[rtic::app(device = lm3s6965)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `8_usize - 9_usize` which would overflow
+ |
+ = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)