diff options
Diffstat (limited to 'ui/single')
-rw-r--r-- | ui/single/exception-invalid.rs | 7 | ||||
-rw-r--r-- | ui/single/exception-invalid.stderr | 8 | ||||
-rw-r--r-- | ui/single/exception-systick-used.rs | 10 | ||||
-rw-r--r-- | ui/single/exception-systick-used.stderr | 8 | ||||
-rw-r--r-- | ui/single/extern-interrupt-not-enough.rs | 7 | ||||
-rw-r--r-- | ui/single/extern-interrupt-not-enough.stderr | 8 | ||||
-rw-r--r-- | ui/single/extern-interrupt-used.rs | 11 | ||||
-rw-r--r-- | ui/single/extern-interrupt-used.stderr | 8 | ||||
-rw-r--r-- | ui/single/locals-cfg.rs | 50 | ||||
-rw-r--r-- | ui/single/locals-cfg.stderr | 33 | ||||
-rw-r--r-- | ui/single/resources-cfg.rs | 75 | ||||
-rw-r--r-- | ui/single/resources-cfg.stderr | 123 | ||||
-rw-r--r-- | ui/single/task-priority-too-high.rs | 38 | ||||
-rw-r--r-- | ui/single/task-priority-too-high.stderr | 9 |
14 files changed, 395 insertions, 0 deletions
diff --git a/ui/single/exception-invalid.rs b/ui/single/exception-invalid.rs new file mode 100644 index 00000000..54f59928 --- /dev/null +++ b/ui/single/exception-invalid.rs @@ -0,0 +1,7 @@ +#![no_main] + +#[rtfm::app(device = lm3s6965)] +const 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..306074b0 --- /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 nmi(_: nmi::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..1155834f --- /dev/null +++ b/ui/single/exception-systick-used.rs @@ -0,0 +1,10 @@ +#![no_main] + +#[rtfm::app(device = lm3s6965)] +const 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..e2ccbd3b --- /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 sys_tick(_: sys_tick::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..59f38068 --- /dev/null +++ b/ui/single/extern-interrupt-used.rs @@ -0,0 +1,11 @@ +#![no_main] + +#[rtfm::app(device = lm3s6965)] +const 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..2e084caf --- /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:20 + | +5 | #[task(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..8761f72e --- /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 {} + } + + #[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..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..906b3e25 --- /dev/null +++ b/ui/single/resources-cfg.rs @@ -0,0 +1,75 @@ +#![no_main] + +#[rtfm::app(device = lm3s6965)] +const APP: () = { + 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) { + 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 {} + } + + #[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..a745e6e2 --- /dev/null +++ b/ui/single/resources-cfg.stderr @@ -0,0 +1,123 @@ +error[E0609]: no field `o1` on type `initResources<'_>` + --> $DIR/resources-cfg.rs:45:21 + | +45 | c.resources.o1; + | ^^ unknown field + | + = note: available fields are: `__marker__` + +error[E0609]: no field `o4` on type `initResources<'_>` + --> $DIR/resources-cfg.rs:46:21 + | +46 | c.resources.o4; + | ^^ unknown field + | + = note: available fields are: `__marker__` + +error[E0609]: no field `o5` on type `initResources<'_>` + --> $DIR/resources-cfg.rs:47:21 + | +47 | c.resources.o5; + | ^^ unknown field + | + = note: available fields are: `__marker__` + +error[E0609]: no field `o6` on type `initResources<'_>` + --> $DIR/resources-cfg.rs:48:21 + | +48 | c.resources.o6; + | ^^ unknown field + | + = note: available fields are: `__marker__` + +error[E0609]: no field `s3` on type `initResources<'_>` + --> $DIR/resources-cfg.rs:49:21 + | +49 | c.resources.s3; + | ^^ unknown field + | + = note: available fields are: `__marker__` + +error[E0609]: no field `o2` on type `idleResources<'_>` + --> $DIR/resources-cfg.rs:54:21 + | +54 | c.resources.o2; + | ^^ unknown field + | + = note: available fields are: `__marker__` + +error[E0609]: no field `o4` on type `idleResources<'_>` + --> $DIR/resources-cfg.rs:55:21 + | +55 | c.resources.o4; + | ^^ unknown field + | + = note: available fields are: `__marker__` + +error[E0609]: no field `s1` on type `idleResources<'_>` + --> $DIR/resources-cfg.rs:56:21 + | +56 | c.resources.s1; + | ^^ unknown field + | + = note: available fields are: `__marker__` + +error[E0609]: no field `s3` on type `idleResources<'_>` + --> $DIR/resources-cfg.rs:57:21 + | +57 | c.resources.s3; + | ^^ unknown field + | + = note: available fields are: `__marker__` + +error[E0609]: no field `o3` on type `uart0Resources<'_>` + --> $DIR/resources-cfg.rs:64:21 + | +64 | c.resources.o3; + | ^^ unknown field + | + = note: available fields are: `__marker__` + +error[E0609]: no field `s1` on type `uart0Resources<'_>` + --> $DIR/resources-cfg.rs:65:21 + | +65 | c.resources.s1; + | ^^ unknown field + | + = note: available fields are: `__marker__` + +error[E0609]: no field `s2` on type `uart0Resources<'_>` + --> $DIR/resources-cfg.rs:66:21 + | +66 | c.resources.s2; + | ^^ unknown field + | + = note: available fields are: `__marker__` + +error[E0609]: no field `s3` on type `uart0Resources<'_>` + --> $DIR/resources-cfg.rs:67:21 + | +67 | c.resources.s3; + | ^^ unknown field + | + = note: available fields are: `__marker__` + +error[E0609]: no field `s2` on type `uart1Resources<'_>` + --> $DIR/resources-cfg.rs:72:21 + | +72 | c.resources.s2; + | ^^ unknown field + | + = note: available fields are: `__marker__` + +error[E0609]: no field `o5` on type `uart1Resources<'_>` + --> $DIR/resources-cfg.rs:73:21 + | +73 | 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..24cb11e5 --- /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) {} + + #[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..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`. |