aboutsummaryrefslogtreecommitdiff
path: root/ui/single
diff options
context:
space:
mode:
Diffstat (limited to 'ui/single')
-rw-r--r--ui/single/exception-invalid.rs7
-rw-r--r--ui/single/exception-invalid.stderr8
-rw-r--r--ui/single/exception-systick-used.rs10
-rw-r--r--ui/single/exception-systick-used.stderr8
-rw-r--r--ui/single/extern-interrupt-not-enough.rs7
-rw-r--r--ui/single/extern-interrupt-not-enough.stderr8
-rw-r--r--ui/single/extern-interrupt-used.rs11
-rw-r--r--ui/single/extern-interrupt-used.stderr8
-rw-r--r--ui/single/locals-cfg.rs50
-rw-r--r--ui/single/locals-cfg.stderr33
-rw-r--r--ui/single/resources-cfg.rs57
-rw-r--r--ui/single/resources-cfg.stderr123
-rw-r--r--ui/single/task-priority-too-high.rs38
-rw-r--r--ui/single/task-priority-too-high.stderr9
14 files changed, 377 insertions, 0 deletions
diff --git a/ui/single/exception-invalid.rs b/ui/single/exception-invalid.rs
new file mode 100644
index 00000000..426cb673
--- /dev/null
+++ b/ui/single/exception-invalid.rs
@@ -0,0 +1,7 @@
+#![no_main]
+
+#[rtfm::app(device = lm3s6965)]
+const APP: () = {
+ #[exception]
+ fn NonMaskableInt(_: NonMaskableInt::Context) {}
+};
diff --git a/ui/single/exception-invalid.stderr b/ui/single/exception-invalid.stderr
new file mode 100644
index 00000000..f7fc2922
--- /dev/null
+++ b/ui/single/exception-invalid.stderr
@@ -0,0 +1,8 @@
+error: only exceptions with configurable priority can be used as hardware tasks
+ --> $DIR/exception-invalid.rs:6:8
+ |
+6 | fn NonMaskableInt(_: NonMaskableInt::Context) {}
+ | ^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/ui/single/exception-systick-used.rs b/ui/single/exception-systick-used.rs
new file mode 100644
index 00000000..d30da1bd
--- /dev/null
+++ b/ui/single/exception-systick-used.rs
@@ -0,0 +1,10 @@
+#![no_main]
+
+#[rtfm::app(device = lm3s6965)]
+const APP: () = {
+ #[exception]
+ fn SysTick(_: SysTick::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..47786c6c
--- /dev/null
+++ b/ui/single/exception-systick-used.stderr
@@ -0,0 +1,8 @@
+error: this exception can't be used because it's being used by the runtime
+ --> $DIR/exception-systick-used.rs:6:8
+ |
+6 | fn SysTick(_: SysTick::Context) {}
+ | ^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/ui/single/extern-interrupt-not-enough.rs b/ui/single/extern-interrupt-not-enough.rs
new file mode 100644
index 00000000..39c5d8ea
--- /dev/null
+++ b/ui/single/extern-interrupt-not-enough.rs
@@ -0,0 +1,7 @@
+#![no_main]
+
+#[rtfm::app(device = lm3s6965)]
+const 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..43249c49
--- /dev/null
+++ b/ui/single/extern-interrupt-not-enough.stderr
@@ -0,0 +1,8 @@
+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) {}
+ | ^
+
+error: aborting due to previous error
+
diff --git a/ui/single/extern-interrupt-used.rs b/ui/single/extern-interrupt-used.rs
new file mode 100644
index 00000000..25f34b36
--- /dev/null
+++ b/ui/single/extern-interrupt-used.rs
@@ -0,0 +1,11 @@
+#![no_main]
+
+#[rtfm::app(device = lm3s6965)]
+const APP: () = {
+ #[interrupt(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..8707b1d2
--- /dev/null
+++ b/ui/single/extern-interrupt-used.stderr
@@ -0,0 +1,8 @@
+error: `extern` interrupts can't be used as hardware tasks
+ --> $DIR/extern-interrupt-used.rs:5:25
+ |
+5 | #[interrupt(binds = UART0)]
+ | ^^^^^
+
+error: aborting due to previous error
+
diff --git a/ui/single/locals-cfg.rs b/ui/single/locals-cfg.rs
new file mode 100644
index 00000000..bcce5ca9
--- /dev/null
+++ b/ui/single/locals-cfg.rs
@@ -0,0 +1,50 @@
+#![no_main]
+
+#[rtfm::app(device = lm3s6965)]
+const APP: () = {
+ #[init]
+ fn init(_: init::Context) {
+ #[cfg(never)]
+ static mut FOO: u32 = 0;
+
+ FOO;
+ }
+
+ #[idle]
+ fn idle(_: idle::Context) -> ! {
+ #[cfg(never)]
+ static mut FOO: u32 = 0;
+
+ FOO;
+
+ loop {}
+ }
+
+ #[exception]
+ fn SVCall(_: SVCall::Context) {
+ #[cfg(never)]
+ static mut FOO: u32 = 0;
+
+ FOO;
+ }
+
+ #[interrupt]
+ 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..fc324f13
--- /dev/null
+++ b/ui/single/locals-cfg.stderr
@@ -0,0 +1,33 @@
+error[E0425]: cannot find value `FOO` in this scope
+ --> $DIR/locals-cfg.rs:10:9
+ |
+10 | FOO;
+ | ^^^ not found in this scope
+
+error[E0425]: cannot find value `FOO` in this scope
+ --> $DIR/locals-cfg.rs:18:9
+ |
+18 | FOO;
+ | ^^^ not found in this scope
+
+error[E0425]: cannot find value `FOO` in this scope
+ --> $DIR/locals-cfg.rs:28:9
+ |
+28 | FOO;
+ | ^^^ not found in this scope
+
+error[E0425]: cannot find value `FOO` in this scope
+ --> $DIR/locals-cfg.rs:36:9
+ |
+36 | FOO;
+ | ^^^ not found in this scope
+
+error[E0425]: cannot find value `FOO` in this scope
+ --> $DIR/locals-cfg.rs:44:9
+ |
+44 | FOO;
+ | ^^^ not found in this scope
+
+error: aborting due to 5 previous errors
+
+For more information about this error, try `rustc --explain E0425`.
diff --git a/ui/single/resources-cfg.rs b/ui/single/resources-cfg.rs
new file mode 100644
index 00000000..f8c36729
--- /dev/null
+++ b/ui/single/resources-cfg.rs
@@ -0,0 +1,57 @@
+#![no_main]
+
+#[rtfm::app(device = lm3s6965)]
+const APP: () = {
+ #[cfg(never)]
+ static mut O1: u32 = 0; // init
+ #[cfg(never)]
+ static mut O2: u32 = 0; // idle
+ #[cfg(never)]
+ static mut O3: u32 = 0; // EXTI0
+ #[cfg(never)]
+ static O4: u32 = 0; // idle
+ #[cfg(never)]
+ static O5: u32 = 0; // EXTI1
+ #[cfg(never)]
+ static O6: u32 = 0; // init
+
+ #[cfg(never)]
+ static mut S1: u32 = 0; // idle & EXTI0
+ #[cfg(never)]
+ static mut S2: u32 = 0; // EXTI0 & EXTI1
+ #[cfg(never)]
+ static S3: u32 = 0;
+
+ #[init(resources = [O1, O4, O5, O6, S3])]
+ fn init(c: init::Context) {
+ c.resources.O1;
+ c.resources.O4;
+ c.resources.O5;
+ c.resources.O6;
+ c.resources.S3;
+ }
+
+ #[idle(resources = [O2, O4, S1, S3])]
+ fn idle(c: idle::Context) -> ! {
+ c.resources.O2;
+ c.resources.O4;
+ c.resources.S1;
+ c.resources.S3;
+
+ loop {}
+ }
+
+ #[interrupt(resources = [O3, S1, S2, S3])]
+ fn UART0(c: UART0::Context) {
+ c.resources.O3;
+ c.resources.S1;
+ c.resources.S2;
+ c.resources.S3;
+ }
+
+ #[interrupt(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..88c34d20
--- /dev/null
+++ b/ui/single/resources-cfg.stderr
@@ -0,0 +1,123 @@
+error[E0609]: no field `O1` on type `initResources<'_>`
+ --> $DIR/resources-cfg.rs:27:21
+ |
+27 | c.resources.O1;
+ | ^^ unknown field
+ |
+ = note: available fields are: `__marker__`
+
+error[E0609]: no field `O4` on type `initResources<'_>`
+ --> $DIR/resources-cfg.rs:28:21
+ |
+28 | c.resources.O4;
+ | ^^ unknown field
+ |
+ = note: available fields are: `__marker__`
+
+error[E0609]: no field `O5` on type `initResources<'_>`
+ --> $DIR/resources-cfg.rs:29:21
+ |
+29 | c.resources.O5;
+ | ^^ unknown field
+ |
+ = note: available fields are: `__marker__`
+
+error[E0609]: no field `O6` on type `initResources<'_>`
+ --> $DIR/resources-cfg.rs:30:21
+ |
+30 | c.resources.O6;
+ | ^^ unknown field
+ |
+ = note: available fields are: `__marker__`
+
+error[E0609]: no field `S3` on type `initResources<'_>`
+ --> $DIR/resources-cfg.rs:31:21
+ |
+31 | c.resources.S3;
+ | ^^ unknown field
+ |
+ = note: available fields are: `__marker__`
+
+error[E0609]: no field `O2` on type `idleResources<'_>`
+ --> $DIR/resources-cfg.rs:36:21
+ |
+36 | c.resources.O2;
+ | ^^ unknown field
+ |
+ = note: available fields are: `__marker__`
+
+error[E0609]: no field `O4` on type `idleResources<'_>`
+ --> $DIR/resources-cfg.rs:37:21
+ |
+37 | c.resources.O4;
+ | ^^ unknown field
+ |
+ = note: available fields are: `__marker__`
+
+error[E0609]: no field `S1` on type `idleResources<'_>`
+ --> $DIR/resources-cfg.rs:38:21
+ |
+38 | c.resources.S1;
+ | ^^ unknown field
+ |
+ = note: available fields are: `__marker__`
+
+error[E0609]: no field `S3` on type `idleResources<'_>`
+ --> $DIR/resources-cfg.rs:39:21
+ |
+39 | c.resources.S3;
+ | ^^ unknown field
+ |
+ = note: available fields are: `__marker__`
+
+error[E0609]: no field `O3` on type `UART0Resources<'_>`
+ --> $DIR/resources-cfg.rs:46:21
+ |
+46 | c.resources.O3;
+ | ^^ unknown field
+ |
+ = note: available fields are: `__marker__`
+
+error[E0609]: no field `S1` on type `UART0Resources<'_>`
+ --> $DIR/resources-cfg.rs:47:21
+ |
+47 | c.resources.S1;
+ | ^^ unknown field
+ |
+ = note: available fields are: `__marker__`
+
+error[E0609]: no field `S2` on type `UART0Resources<'_>`
+ --> $DIR/resources-cfg.rs:48:21
+ |
+48 | c.resources.S2;
+ | ^^ unknown field
+ |
+ = note: available fields are: `__marker__`
+
+error[E0609]: no field `S3` on type `UART0Resources<'_>`
+ --> $DIR/resources-cfg.rs:49:21
+ |
+49 | c.resources.S3;
+ | ^^ unknown field
+ |
+ = note: available fields are: `__marker__`
+
+error[E0609]: no field `S2` on type `UART1Resources<'_>`
+ --> $DIR/resources-cfg.rs:54:21
+ |
+54 | c.resources.S2;
+ | ^^ unknown field
+ |
+ = note: available fields are: `__marker__`
+
+error[E0609]: no field `O5` on type `UART1Resources<'_>`
+ --> $DIR/resources-cfg.rs:55:21
+ |
+55 | c.resources.O5;
+ | ^^ unknown field
+ |
+ = note: available fields are: `__marker__`
+
+error: aborting due to 15 previous errors
+
+For more information about this error, try `rustc --explain E0609`.
diff --git a/ui/single/task-priority-too-high.rs b/ui/single/task-priority-too-high.rs
new file mode 100644
index 00000000..c7c9dc9b
--- /dev/null
+++ b/ui/single/task-priority-too-high.rs
@@ -0,0 +1,38 @@
+#![no_main]
+
+use rtfm::app;
+
+#[rtfm::app(device = lm3s6965)]
+const APP: () = {
+ #[init]
+ fn init(_: init::Context) {}
+
+ #[interrupt(priority = 1)]
+ fn GPIOA(_: GPIOA::Context) {}
+
+ #[interrupt(priority = 2)]
+ fn GPIOB(_: GPIOB::Context) {}
+
+ #[interrupt(priority = 3)]
+ fn GPIOC(_: GPIOC::Context) {}
+
+ #[interrupt(priority = 4)]
+ fn GPIOD(_: GPIOD::Context) {}
+
+ #[interrupt(priority = 5)]
+ fn GPIOE(_: GPIOE::Context) {}
+
+ #[interrupt(priority = 6)]
+ fn UART0(_: UART0::Context) {}
+
+ #[interrupt(priority = 7)]
+ fn UART1(_: UART1::Context) {}
+
+ // OK, this is the maximum priority supported by the device
+ #[interrupt(priority = 8)]
+ fn SSI0(_: SSI0::Context) {}
+
+ // this value is too high!
+ #[interrupt(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..b402a95c
--- /dev/null
+++ b/ui/single/task-priority-too-high.stderr
@@ -0,0 +1,9 @@
+error[E0080]: evaluation of constant value failed
+ --> $DIR/task-priority-too-high.rs:5:1
+ |
+5 | #[rtfm::app(device = lm3s6965)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to subtract with overflow
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0080`.