mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-19 14:25:18 +01:00
RTIC v2: Initial commit
rtic-syntax is now part of RTIC repository
This commit is contained in:
parent
1c5db277e4
commit
7614b96fe4
167 changed files with 5219 additions and 602 deletions
28
macros/ui/async-local-resouces.rs
Normal file
28
macros/ui/async-local-resouces.rs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[shared]
|
||||
struct Shared {
|
||||
#[lock_free]
|
||||
e: u32,
|
||||
}
|
||||
|
||||
#[local]
|
||||
struct Local {}
|
||||
|
||||
#[init]
|
||||
fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {}
|
||||
|
||||
// e ok
|
||||
#[task(priority = 1, shared = [e])]
|
||||
fn uart0(cx: uart0::Context) {}
|
||||
|
||||
// e ok
|
||||
#[task(priority = 1, shared = [e])]
|
||||
fn uart1(cx: uart1::Context) {}
|
||||
|
||||
// e not ok
|
||||
#[task(priority = 1, shared = [e])]
|
||||
async fn async_task(cx: async_task::Context) {}
|
||||
}
|
||||
5
macros/ui/async-local-resouces.stderr
Normal file
5
macros/ui/async-local-resouces.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: Lock free shared resource "e" is used by an async tasks, which is forbidden
|
||||
--> ui/async-local-resouces.rs:26:36
|
||||
|
|
||||
26 | #[task(priority = 1, shared = [e])]
|
||||
| ^
|
||||
19
macros/ui/async-zero-prio-tasks.rs
Normal file
19
macros/ui/async-zero-prio-tasks.rs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[shared]
|
||||
struct Shared {}
|
||||
|
||||
#[local]
|
||||
struct Local {}
|
||||
|
||||
#[init]
|
||||
fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {}
|
||||
|
||||
#[task(priority = 0)]
|
||||
fn foo(_: foo::Context) {}
|
||||
|
||||
#[idle]
|
||||
fn idle(_: idle::Context) -> ! {}
|
||||
}
|
||||
11
macros/ui/async-zero-prio-tasks.stderr
Normal file
11
macros/ui/async-zero-prio-tasks.stderr
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
error: Software task "foo" has priority 0, but `#[idle]` is defined. 0-priority software tasks are only allowed if there is no `#[idle]`.
|
||||
--> ui/async-zero-prio-tasks.rs:15:8
|
||||
|
|
||||
15 | fn foo(_: foo::Context) {}
|
||||
| ^^^
|
||||
|
||||
error: Software task "foo" has priority 0, but is not `async`. 0-priority software tasks must be `async`.
|
||||
--> ui/async-zero-prio-tasks.rs:15:8
|
||||
|
|
||||
15 | fn foo(_: foo::Context) {}
|
||||
| ^^^
|
||||
16
macros/ui/extern-interrupt-used.rs
Normal file
16
macros/ui/extern-interrupt-used.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(parse_extern_interrupt, parse_binds, device = mock, dispatchers = [EXTI0])]
|
||||
mod app {
|
||||
#[shared]
|
||||
struct Shared {}
|
||||
|
||||
#[local]
|
||||
struct Local {}
|
||||
|
||||
#[init]
|
||||
fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {}
|
||||
|
||||
#[task(binds = EXTI0)]
|
||||
fn foo(_: foo::Context) {}
|
||||
}
|
||||
5
macros/ui/extern-interrupt-used.stderr
Normal file
5
macros/ui/extern-interrupt-used.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: dispatcher interrupts can't be used as hardware tasks
|
||||
--> $DIR/extern-interrupt-used.rs:14:20
|
||||
|
|
||||
14 | #[task(binds = EXTI0)]
|
||||
| ^^^^^
|
||||
9
macros/ui/idle-double-local.rs
Normal file
9
macros/ui/idle-double-local.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[idle(local = [A], local = [B])]
|
||||
fn idle(_: idle::Context) -> ! {
|
||||
loop {}
|
||||
}
|
||||
}
|
||||
5
macros/ui/idle-double-local.stderr
Normal file
5
macros/ui/idle-double-local.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: argument appears more than once
|
||||
--> $DIR/idle-double-local.rs:5:25
|
||||
|
|
||||
5 | #[idle(local = [A], local = [B])]
|
||||
| ^^^^^
|
||||
9
macros/ui/idle-double-shared.rs
Normal file
9
macros/ui/idle-double-shared.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[idle(shared = [A], shared = [B])]
|
||||
fn idle(_: idle::Context) -> ! {
|
||||
loop {}
|
||||
}
|
||||
}
|
||||
5
macros/ui/idle-double-shared.stderr
Normal file
5
macros/ui/idle-double-shared.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: argument appears more than once
|
||||
--> $DIR/idle-double-shared.rs:5:26
|
||||
|
|
||||
5 | #[idle(shared = [A], shared = [B])]
|
||||
| ^^^^^^
|
||||
9
macros/ui/idle-input.rs
Normal file
9
macros/ui/idle-input.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[idle]
|
||||
fn idle(_: idle::Context, _undef: u32) -> ! {
|
||||
loop {}
|
||||
}
|
||||
}
|
||||
5
macros/ui/idle-input.stderr
Normal file
5
macros/ui/idle-input.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: this `#[idle]` function must have signature `fn(idle::Context) -> !`
|
||||
--> ui/idle-input.rs:6:8
|
||||
|
|
||||
6 | fn idle(_: idle::Context, _undef: u32) -> ! {
|
||||
| ^^^^
|
||||
9
macros/ui/idle-no-context.rs
Normal file
9
macros/ui/idle-no-context.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[idle]
|
||||
fn idle() -> ! {
|
||||
loop {}
|
||||
}
|
||||
}
|
||||
5
macros/ui/idle-no-context.stderr
Normal file
5
macros/ui/idle-no-context.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: this `#[idle]` function must have signature `fn(idle::Context) -> !`
|
||||
--> ui/idle-no-context.rs:6:8
|
||||
|
|
||||
6 | fn idle() -> ! {
|
||||
| ^^^^
|
||||
7
macros/ui/idle-not-divergent.rs
Normal file
7
macros/ui/idle-not-divergent.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[idle]
|
||||
fn idle(_: idle::Context) {}
|
||||
}
|
||||
5
macros/ui/idle-not-divergent.stderr
Normal file
5
macros/ui/idle-not-divergent.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: this `#[idle]` function must have signature `fn(idle::Context) -> !`
|
||||
--> ui/idle-not-divergent.rs:6:8
|
||||
|
|
||||
6 | fn idle(_: idle::Context) {}
|
||||
| ^^^^
|
||||
9
macros/ui/idle-output.rs
Normal file
9
macros/ui/idle-output.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[idle]
|
||||
fn idle(_: idle::Context) -> u32 {
|
||||
0
|
||||
}
|
||||
}
|
||||
5
macros/ui/idle-output.stderr
Normal file
5
macros/ui/idle-output.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: this `#[idle]` function must have signature `fn(idle::Context) -> !`
|
||||
--> ui/idle-output.rs:6:8
|
||||
|
|
||||
6 | fn idle(_: idle::Context) -> u32 {
|
||||
| ^^^^
|
||||
9
macros/ui/idle-pub.rs
Normal file
9
macros/ui/idle-pub.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[idle]
|
||||
pub fn idle(_: idle::Context) -> ! {
|
||||
loop {}
|
||||
}
|
||||
}
|
||||
5
macros/ui/idle-pub.stderr
Normal file
5
macros/ui/idle-pub.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: this `#[idle]` function must have signature `fn(idle::Context) -> !`
|
||||
--> ui/idle-pub.rs:6:12
|
||||
|
|
||||
6 | pub fn idle(_: idle::Context) -> ! {
|
||||
| ^^^^
|
||||
9
macros/ui/idle-unsafe.rs
Normal file
9
macros/ui/idle-unsafe.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[idle]
|
||||
unsafe fn idle(_: idle::Context) -> ! {
|
||||
loop {}
|
||||
}
|
||||
}
|
||||
5
macros/ui/idle-unsafe.stderr
Normal file
5
macros/ui/idle-unsafe.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: this `#[idle]` function must have signature `fn(idle::Context) -> !`
|
||||
--> ui/idle-unsafe.rs:6:15
|
||||
|
|
||||
6 | unsafe fn idle(_: idle::Context) -> ! {
|
||||
| ^^^^
|
||||
13
macros/ui/init-divergent.rs
Normal file
13
macros/ui/init-divergent.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[shared]
|
||||
struct Shared {}
|
||||
|
||||
#[local]
|
||||
struct Local {}
|
||||
|
||||
#[init]
|
||||
fn init(_: init::Context) -> ! {}
|
||||
}
|
||||
5
macros/ui/init-divergent.stderr
Normal file
5
macros/ui/init-divergent.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: the `#[init]` function must have signature `fn(init::Context) -> (Shared resources struct, Local resources struct, init::Monotonics)`
|
||||
--> $DIR/init-divergent.rs:12:8
|
||||
|
|
||||
12 | fn init(_: init::Context) -> ! {}
|
||||
| ^^^^
|
||||
7
macros/ui/init-double-local.rs
Normal file
7
macros/ui/init-double-local.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[init(local = [A], local = [B])]
|
||||
fn init(_: init::Context) {}
|
||||
}
|
||||
5
macros/ui/init-double-local.stderr
Normal file
5
macros/ui/init-double-local.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: argument appears more than once
|
||||
--> $DIR/init-double-local.rs:5:25
|
||||
|
|
||||
5 | #[init(local = [A], local = [B])]
|
||||
| ^^^^^
|
||||
7
macros/ui/init-double-shared.rs
Normal file
7
macros/ui/init-double-shared.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[init(shared = [A], shared = [B])]
|
||||
fn init(_: init::Context) {}
|
||||
}
|
||||
5
macros/ui/init-double-shared.stderr
Normal file
5
macros/ui/init-double-shared.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: unexpected argument
|
||||
--> $DIR/init-double-shared.rs:5:12
|
||||
|
|
||||
5 | #[init(shared = [A], shared = [B])]
|
||||
| ^^^^^^
|
||||
13
macros/ui/init-input.rs
Normal file
13
macros/ui/init-input.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[shared]
|
||||
struct Shared {}
|
||||
|
||||
#[local]
|
||||
struct Local {}
|
||||
|
||||
#[init]
|
||||
fn init(_: init::Context, _undef: u32) -> (Shared, Local, init::Monotonics) {}
|
||||
}
|
||||
5
macros/ui/init-input.stderr
Normal file
5
macros/ui/init-input.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: the `#[init]` function must have signature `fn(init::Context) -> (Shared resources struct, Local resources struct, init::Monotonics)`
|
||||
--> $DIR/init-input.rs:12:8
|
||||
|
|
||||
12 | fn init(_: init::Context, _undef: u32) -> (Shared, Local, init::Monotonics) {}
|
||||
| ^^^^
|
||||
13
macros/ui/init-no-context.rs
Normal file
13
macros/ui/init-no-context.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[shared]
|
||||
struct Shared {}
|
||||
|
||||
#[local]
|
||||
struct Local {}
|
||||
|
||||
#[init]
|
||||
fn init() -> (Shared, Local, init::Monotonics) {}
|
||||
}
|
||||
5
macros/ui/init-no-context.stderr
Normal file
5
macros/ui/init-no-context.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: the `#[init]` function must have signature `fn(init::Context) -> (Shared resources struct, Local resources struct, init::Monotonics)`
|
||||
--> $DIR/init-no-context.rs:12:8
|
||||
|
|
||||
12 | fn init() -> (Shared, Local, init::Monotonics) {}
|
||||
| ^^^^
|
||||
9
macros/ui/init-output.rs
Normal file
9
macros/ui/init-output.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[init]
|
||||
fn init(_: init::Context) -> u32 {
|
||||
0
|
||||
}
|
||||
}
|
||||
5
macros/ui/init-output.stderr
Normal file
5
macros/ui/init-output.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: the `#[init]` function must have signature `fn(init::Context) -> (Shared resources struct, Local resources struct, init::Monotonics)`
|
||||
--> $DIR/init-output.rs:6:8
|
||||
|
|
||||
6 | fn init(_: init::Context) -> u32 {
|
||||
| ^^^^
|
||||
13
macros/ui/init-pub.rs
Normal file
13
macros/ui/init-pub.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[shared]
|
||||
struct Shared {}
|
||||
|
||||
#[local]
|
||||
struct Local {}
|
||||
|
||||
#[init]
|
||||
pub fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {}
|
||||
}
|
||||
5
macros/ui/init-pub.stderr
Normal file
5
macros/ui/init-pub.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: the `#[init]` function must have signature `fn(init::Context) -> (Shared resources struct, Local resources struct, init::Monotonics)`
|
||||
--> $DIR/init-pub.rs:12:12
|
||||
|
|
||||
12 | pub fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {}
|
||||
| ^^^^
|
||||
7
macros/ui/init-unsafe.rs
Normal file
7
macros/ui/init-unsafe.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[init]
|
||||
unsafe fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {}
|
||||
}
|
||||
5
macros/ui/init-unsafe.stderr
Normal file
5
macros/ui/init-unsafe.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: the `#[init]` function must have signature `fn(init::Context) -> (Shared resources struct, Local resources struct, init::Monotonics)`
|
||||
--> $DIR/init-unsafe.rs:6:15
|
||||
|
|
||||
6 | unsafe fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {}
|
||||
| ^^^^
|
||||
10
macros/ui/interrupt-double.rs
Normal file
10
macros/ui/interrupt-double.rs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(parse_binds, device = mock)]
|
||||
mod app {
|
||||
#[task(binds = UART0)]
|
||||
fn foo(_: foo::Context) {}
|
||||
|
||||
#[task(binds = UART0)]
|
||||
fn bar(_: bar::Context) {}
|
||||
}
|
||||
5
macros/ui/interrupt-double.stderr
Normal file
5
macros/ui/interrupt-double.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: this interrupt is already bound
|
||||
--> $DIR/interrupt-double.rs:8:20
|
||||
|
|
||||
8 | #[task(binds = UART0)]
|
||||
| ^^^^^
|
||||
21
macros/ui/local-collision-2.rs
Normal file
21
macros/ui/local-collision-2.rs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[shared]
|
||||
struct Shared {}
|
||||
|
||||
#[local]
|
||||
struct Local {
|
||||
a: u32,
|
||||
}
|
||||
|
||||
fn bar(_: bar::Context) {}
|
||||
|
||||
#[task(local = [a: u8 = 3])]
|
||||
fn bar(_: bar::Context) {}
|
||||
|
||||
#[init(local = [a: u16 = 2])]
|
||||
fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {}
|
||||
}
|
||||
|
||||
17
macros/ui/local-collision-2.stderr
Normal file
17
macros/ui/local-collision-2.stderr
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
error: Local resource "a" is used by multiple tasks or collides with multiple definitions
|
||||
--> $DIR/local-collision-2.rs:10:9
|
||||
|
|
||||
10 | a: u32,
|
||||
| ^
|
||||
|
||||
error: Local resource "a" is used by multiple tasks or collides with multiple definitions
|
||||
--> $DIR/local-collision-2.rs:18:21
|
||||
|
|
||||
18 | #[init(local = [a: u16 = 2])]
|
||||
| ^
|
||||
|
||||
error: Local resource "a" is used by multiple tasks or collides with multiple definitions
|
||||
--> $DIR/local-collision-2.rs:15:21
|
||||
|
|
||||
15 | #[task(local = [a: u8 = 3])]
|
||||
| ^
|
||||
21
macros/ui/local-collision.rs
Normal file
21
macros/ui/local-collision.rs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[shared]
|
||||
struct Shared {}
|
||||
|
||||
#[local]
|
||||
struct Local {
|
||||
a: u32,
|
||||
}
|
||||
|
||||
#[task(local = [a])]
|
||||
fn foo(_: foo::Context) {}
|
||||
|
||||
#[task(local = [a: u8 = 3])]
|
||||
fn bar(_: bar::Context) {}
|
||||
|
||||
#[init]
|
||||
fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {}
|
||||
}
|
||||
11
macros/ui/local-collision.stderr
Normal file
11
macros/ui/local-collision.stderr
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
error: Local resource "a" is used by multiple tasks or collides with multiple definitions
|
||||
--> $DIR/local-collision.rs:10:9
|
||||
|
|
||||
10 | a: u32,
|
||||
| ^
|
||||
|
||||
error: Local resource "a" is used by multiple tasks or collides with multiple definitions
|
||||
--> $DIR/local-collision.rs:16:21
|
||||
|
|
||||
16 | #[task(local = [a: u8 = 3])]
|
||||
| ^
|
||||
16
macros/ui/local-malformed-1.rs
Normal file
16
macros/ui/local-malformed-1.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[shared]
|
||||
struct Shared {}
|
||||
|
||||
#[local]
|
||||
struct Local {}
|
||||
|
||||
#[task(local = [a:])]
|
||||
fn foo(_: foo::Context) {}
|
||||
|
||||
#[init]
|
||||
fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {}
|
||||
}
|
||||
5
macros/ui/local-malformed-1.stderr
Normal file
5
macros/ui/local-malformed-1.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: unexpected end of input, expected one of: `for`, parentheses, `fn`, `unsafe`, `extern`, identifier, `::`, `<`, square brackets, `*`, `&`, `!`, `impl`, `_`, lifetime
|
||||
--> ui/local-malformed-1.rs:11:23
|
||||
|
|
||||
11 | #[task(local = [a:])]
|
||||
| ^
|
||||
16
macros/ui/local-malformed-2.rs
Normal file
16
macros/ui/local-malformed-2.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[shared]
|
||||
struct Shared {}
|
||||
|
||||
#[local]
|
||||
struct Local {}
|
||||
|
||||
#[task(local = [a: u32])]
|
||||
fn foo(_: foo::Context) {}
|
||||
|
||||
#[init]
|
||||
fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {}
|
||||
}
|
||||
5
macros/ui/local-malformed-2.stderr
Normal file
5
macros/ui/local-malformed-2.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: malformed, expected 'IDENT: TYPE = EXPR'
|
||||
--> ui/local-malformed-2.rs:11:21
|
||||
|
|
||||
11 | #[task(local = [a: u32])]
|
||||
| ^
|
||||
16
macros/ui/local-malformed-3.rs
Normal file
16
macros/ui/local-malformed-3.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[shared]
|
||||
struct Shared {}
|
||||
|
||||
#[local]
|
||||
struct Local {}
|
||||
|
||||
#[task(local = [a: u32 =])]
|
||||
fn foo(_: foo::Context) {}
|
||||
|
||||
#[init]
|
||||
fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {}
|
||||
}
|
||||
5
macros/ui/local-malformed-3.stderr
Normal file
5
macros/ui/local-malformed-3.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: unexpected end of input, expected expression
|
||||
--> ui/local-malformed-3.rs:11:29
|
||||
|
|
||||
11 | #[task(local = [a: u32 =])]
|
||||
| ^
|
||||
16
macros/ui/local-malformed-4.rs
Normal file
16
macros/ui/local-malformed-4.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[shared]
|
||||
struct Shared {}
|
||||
|
||||
#[local]
|
||||
struct Local {}
|
||||
|
||||
#[task(local = [a = u32])]
|
||||
fn foo(_: foo::Context) {}
|
||||
|
||||
#[init]
|
||||
fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {}
|
||||
}
|
||||
5
macros/ui/local-malformed-4.stderr
Normal file
5
macros/ui/local-malformed-4.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: malformed, expected a type
|
||||
--> ui/local-malformed-4.rs:11:21
|
||||
|
|
||||
11 | #[task(local = [a = u32])]
|
||||
| ^
|
||||
16
macros/ui/local-not-declared.rs
Normal file
16
macros/ui/local-not-declared.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[shared]
|
||||
struct Shared {}
|
||||
|
||||
#[local]
|
||||
struct Local {}
|
||||
|
||||
#[task(local = [A])]
|
||||
fn foo(_: foo::Context) {}
|
||||
|
||||
#[init]
|
||||
fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {}
|
||||
}
|
||||
5
macros/ui/local-not-declared.stderr
Normal file
5
macros/ui/local-not-declared.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: this local resource has NOT been declared
|
||||
--> $DIR/local-not-declared.rs:11:21
|
||||
|
|
||||
11 | #[task(local = [A])]
|
||||
| ^
|
||||
9
macros/ui/local-pub.rs
Normal file
9
macros/ui/local-pub.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[local]
|
||||
struct Local {
|
||||
pub x: u32,
|
||||
}
|
||||
}
|
||||
5
macros/ui/local-pub.stderr
Normal file
5
macros/ui/local-pub.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: this field must have inherited / private visibility
|
||||
--> $DIR/local-pub.rs:7:13
|
||||
|
|
||||
7 | pub x: u32,
|
||||
| ^
|
||||
14
macros/ui/local-shared-attribute.rs
Normal file
14
macros/ui/local-shared-attribute.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[task(local = [
|
||||
#[test]
|
||||
a: u32 = 0, // Ok
|
||||
#[test]
|
||||
b, // Error
|
||||
])]
|
||||
fn foo(_: foo::Context) {
|
||||
|
||||
}
|
||||
}
|
||||
5
macros/ui/local-shared-attribute.stderr
Normal file
5
macros/ui/local-shared-attribute.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: attributes are not supported here
|
||||
--> $DIR/local-shared-attribute.rs:8:9
|
||||
|
|
||||
8 | #[test]
|
||||
| ^
|
||||
28
macros/ui/local-shared.rs
Normal file
28
macros/ui/local-shared.rs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[shared]
|
||||
struct Shared {}
|
||||
|
||||
#[local]
|
||||
struct Local {
|
||||
l1: u32,
|
||||
l2: u32,
|
||||
}
|
||||
|
||||
#[init]
|
||||
fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {}
|
||||
|
||||
// l2 ok
|
||||
#[idle(local = [l2])]
|
||||
fn idle(cx: idle::Context) -> ! {}
|
||||
|
||||
// l1 rejected (not local)
|
||||
#[task(priority = 1, local = [l1])]
|
||||
fn uart0(cx: uart0::Context) {}
|
||||
|
||||
// l1 rejected (not lock_free)
|
||||
#[task(priority = 2, local = [l1])]
|
||||
fn uart1(cx: uart1::Context) {}
|
||||
}
|
||||
11
macros/ui/local-shared.stderr
Normal file
11
macros/ui/local-shared.stderr
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
error: Local resource "l1" is used by multiple tasks or collides with multiple definitions
|
||||
--> $DIR/local-shared.rs:22:35
|
||||
|
|
||||
22 | #[task(priority = 1, local = [l1])]
|
||||
| ^^
|
||||
|
||||
error: Local resource "l1" is used by multiple tasks or collides with multiple definitions
|
||||
--> $DIR/local-shared.rs:26:35
|
||||
|
|
||||
26 | #[task(priority = 2, local = [l1])]
|
||||
| ^^
|
||||
10
macros/ui/monotonic-binds-collision-task.rs
Normal file
10
macros/ui/monotonic-binds-collision-task.rs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(parse_extern_interrupt, parse_binds, device = mock)]
|
||||
mod app {
|
||||
#[monotonic(binds = Tim1)]
|
||||
type Fast1 = hal::Tim1Monotonic;
|
||||
|
||||
#[task(binds = Tim1)]
|
||||
fn foo(_: foo::Context) {}
|
||||
}
|
||||
5
macros/ui/monotonic-binds-collision-task.stderr
Normal file
5
macros/ui/monotonic-binds-collision-task.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: this interrupt is already bound
|
||||
--> $DIR/monotonic-binds-collision-task.rs:8:20
|
||||
|
|
||||
8 | #[task(binds = Tim1)]
|
||||
| ^^^^
|
||||
10
macros/ui/monotonic-binds-collision.rs
Normal file
10
macros/ui/monotonic-binds-collision.rs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[monotonic(binds = Tim1)]
|
||||
type Fast1 = hal::Tim1Monotonic;
|
||||
|
||||
#[monotonic(binds = Tim1)]
|
||||
type Fast2 = hal::Tim2Monotonic;
|
||||
}
|
||||
5
macros/ui/monotonic-binds-collision.stderr
Normal file
5
macros/ui/monotonic-binds-collision.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: this interrupt is already bound
|
||||
--> $DIR/monotonic-binds-collision.rs:8:25
|
||||
|
|
||||
8 | #[monotonic(binds = Tim1)]
|
||||
| ^^^^
|
||||
7
macros/ui/monotonic-double-binds.rs
Normal file
7
macros/ui/monotonic-double-binds.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[monotonic(binds = Tim1, binds = Tim2)]
|
||||
type Fast = hal::Tim1Monotonic;
|
||||
}
|
||||
5
macros/ui/monotonic-double-binds.stderr
Normal file
5
macros/ui/monotonic-double-binds.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: argument appears more than once
|
||||
--> $DIR/monotonic-double-binds.rs:5:31
|
||||
|
|
||||
5 | #[monotonic(binds = Tim1, binds = Tim2)]
|
||||
| ^^^^^
|
||||
7
macros/ui/monotonic-double-default.rs
Normal file
7
macros/ui/monotonic-double-default.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[monotonic(binds = Tim1, default = true, default = false)]
|
||||
type Fast = hal::Tim1Monotonic;
|
||||
}
|
||||
5
macros/ui/monotonic-double-default.stderr
Normal file
5
macros/ui/monotonic-double-default.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: argument appears more than once
|
||||
--> $DIR/monotonic-double-default.rs:5:47
|
||||
|
|
||||
5 | #[monotonic(binds = Tim1, default = true, default = false)]
|
||||
| ^^^^^^^
|
||||
7
macros/ui/monotonic-double-prio.rs
Normal file
7
macros/ui/monotonic-double-prio.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[monotonic(binds = Tim1, priority = 1, priority = 2)]
|
||||
type Fast = hal::Tim1Monotonic;
|
||||
}
|
||||
5
macros/ui/monotonic-double-prio.stderr
Normal file
5
macros/ui/monotonic-double-prio.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: argument appears more than once
|
||||
--> $DIR/monotonic-double-prio.rs:5:45
|
||||
|
|
||||
5 | #[monotonic(binds = Tim1, priority = 1, priority = 2)]
|
||||
| ^^^^^^^^
|
||||
10
macros/ui/monotonic-double.rs
Normal file
10
macros/ui/monotonic-double.rs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[monotonic(binds = Tim1)]
|
||||
type Fast = hal::Tim1Monotonic;
|
||||
|
||||
#[monotonic(binds = Tim1)]
|
||||
type Fast = hal::Tim1Monotonic;
|
||||
}
|
||||
5
macros/ui/monotonic-double.stderr
Normal file
5
macros/ui/monotonic-double.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: `#[monotonic(...)]` on a specific type must appear at most once
|
||||
--> ui/monotonic-double.rs:9:10
|
||||
|
|
||||
9 | type Fast = hal::Tim1Monotonic;
|
||||
| ^^^^
|
||||
10
macros/ui/monotonic-name-collision.rs
Normal file
10
macros/ui/monotonic-name-collision.rs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[monotonic(binds = Tim1)]
|
||||
type Fast1 = hal::Tim1Monotonic;
|
||||
|
||||
#[monotonic(binds = Tim2)]
|
||||
type Fast1 = hal::Tim2Monotonic;
|
||||
}
|
||||
5
macros/ui/monotonic-name-collision.stderr
Normal file
5
macros/ui/monotonic-name-collision.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: `#[monotonic(...)]` on a specific type must appear at most once
|
||||
--> ui/monotonic-name-collision.rs:9:10
|
||||
|
|
||||
9 | type Fast1 = hal::Tim2Monotonic;
|
||||
| ^^^^^
|
||||
7
macros/ui/monotonic-no-binds.rs
Normal file
7
macros/ui/monotonic-no-binds.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[monotonic()]
|
||||
type Fast = hal::Tim1Monotonic;
|
||||
}
|
||||
5
macros/ui/monotonic-no-binds.stderr
Normal file
5
macros/ui/monotonic-no-binds.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: `binds = ...` is missing
|
||||
--> $DIR/monotonic-no-binds.rs:5:17
|
||||
|
|
||||
5 | #[monotonic()]
|
||||
| ^
|
||||
8
macros/ui/monotonic-no-paran.rs
Normal file
8
macros/ui/monotonic-no-paran.rs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[monotonic]
|
||||
type Fast = hal::Tim1Monotonic;
|
||||
}
|
||||
|
||||
5
macros/ui/monotonic-no-paran.stderr
Normal file
5
macros/ui/monotonic-no-paran.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: expected opening ( in #[monotonic( ... )]
|
||||
--> ui/monotonic-no-paran.rs:5:7
|
||||
|
|
||||
5 | #[monotonic]
|
||||
| ^^^^^^^^^
|
||||
10
macros/ui/monotonic-timer-collision.rs
Normal file
10
macros/ui/monotonic-timer-collision.rs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[monotonic(binds = Tim1)]
|
||||
type Fast1 = hal::Tim1Monotonic;
|
||||
|
||||
#[monotonic(binds = Tim2)]
|
||||
type Fast2 = hal::Tim1Monotonic;
|
||||
}
|
||||
5
macros/ui/monotonic-timer-collision.stderr
Normal file
5
macros/ui/monotonic-timer-collision.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: this type is already used by another monotonic
|
||||
--> $DIR/monotonic-timer-collision.rs:9:18
|
||||
|
|
||||
9 | type Fast2 = hal::Tim1Monotonic;
|
||||
| ^^^
|
||||
8
macros/ui/monotonic-with-attrs.rs
Normal file
8
macros/ui/monotonic-with-attrs.rs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[no_mangle]
|
||||
#[monotonic(binds = Tim1)]
|
||||
type Fast = hal::Tim1Monotonic;
|
||||
}
|
||||
5
macros/ui/monotonic-with-attrs.stderr
Normal file
5
macros/ui/monotonic-with-attrs.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: Monotonic does not support attributes other than `#[cfg]`
|
||||
--> $DIR/monotonic-with-attrs.rs:5:7
|
||||
|
|
||||
5 | #[no_mangle]
|
||||
| ^^^^^^^^^
|
||||
5
macros/ui/pub-local.stderr
Normal file
5
macros/ui/pub-local.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: this field must have inherited / private visibility
|
||||
--> $DIR/pub-local.rs:7:13
|
||||
|
|
||||
7 | pub x: u32,
|
||||
| ^
|
||||
5
macros/ui/pub-shared.stderr
Normal file
5
macros/ui/pub-shared.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: this field must have inherited / private visibility
|
||||
--> $DIR/pub-shared.rs:7:13
|
||||
|
|
||||
7 | pub x: u32,
|
||||
| ^
|
||||
38
macros/ui/shared-lock-free.rs
Normal file
38
macros/ui/shared-lock-free.rs
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[shared]
|
||||
struct Shared {
|
||||
// An exclusive, early resource
|
||||
#[lock_free]
|
||||
e1: u32,
|
||||
|
||||
// An exclusive, late resource
|
||||
#[lock_free]
|
||||
e2: u32,
|
||||
}
|
||||
|
||||
#[local]
|
||||
struct Local {}
|
||||
|
||||
#[init]
|
||||
fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {}
|
||||
|
||||
// e2 ok
|
||||
#[idle(shared = [e2])]
|
||||
fn idle(cx: idle::Context) -> ! {
|
||||
debug::exit(debug::EXIT_SUCCESS);
|
||||
loop {}
|
||||
}
|
||||
|
||||
// e1 rejected (not lock_free)
|
||||
#[task(priority = 1, shared = [e1])]
|
||||
fn uart0(cx: uart0::Context) {
|
||||
*cx.resources.e1 += 10;
|
||||
}
|
||||
|
||||
// e1 rejected (not lock_free)
|
||||
#[task(priority = 2, shared = [e1])]
|
||||
fn uart1(cx: uart1::Context) {}
|
||||
}
|
||||
17
macros/ui/shared-lock-free.stderr
Normal file
17
macros/ui/shared-lock-free.stderr
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
error: Lock free shared resource "e1" is used by tasks at different priorities
|
||||
--> $DIR/shared-lock-free.rs:9:9
|
||||
|
|
||||
9 | e1: u32,
|
||||
| ^^
|
||||
|
||||
error: Shared resource "e1" is declared lock free but used by tasks at different priorities
|
||||
--> $DIR/shared-lock-free.rs:30:36
|
||||
|
|
||||
30 | #[task(priority = 1, shared = [e1])]
|
||||
| ^^
|
||||
|
||||
error: Shared resource "e1" is declared lock free but used by tasks at different priorities
|
||||
--> $DIR/shared-lock-free.rs:36:36
|
||||
|
|
||||
36 | #[task(priority = 2, shared = [e1])]
|
||||
| ^^
|
||||
16
macros/ui/shared-not-declared.rs
Normal file
16
macros/ui/shared-not-declared.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[shared]
|
||||
struct Shared {}
|
||||
|
||||
#[local]
|
||||
struct Local {}
|
||||
|
||||
#[task(shared = [A])]
|
||||
fn foo(_: foo::Context) {}
|
||||
|
||||
#[init]
|
||||
fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {}
|
||||
}
|
||||
5
macros/ui/shared-not-declared.stderr
Normal file
5
macros/ui/shared-not-declared.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: this shared resource has NOT been declared
|
||||
--> $DIR/shared-not-declared.rs:11:22
|
||||
|
|
||||
11 | #[task(shared = [A])]
|
||||
| ^
|
||||
9
macros/ui/shared-pub.rs
Normal file
9
macros/ui/shared-pub.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[shared]
|
||||
struct Shared {
|
||||
pub x: u32,
|
||||
}
|
||||
}
|
||||
5
macros/ui/shared-pub.stderr
Normal file
5
macros/ui/shared-pub.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: this field must have inherited / private visibility
|
||||
--> $DIR/shared-pub.rs:7:13
|
||||
|
|
||||
7 | pub x: u32,
|
||||
| ^
|
||||
7
macros/ui/task-bind.rs
Normal file
7
macros/ui/task-bind.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[task(binds = UART0)]
|
||||
fn foo(_: foo::Context) {}
|
||||
}
|
||||
5
macros/ui/task-bind.stderr
Normal file
5
macros/ui/task-bind.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: Unexpected bind in task argument. Binds are only parsed if Settings::parse_binds is set.
|
||||
--> $DIR/task-bind.rs:5:12
|
||||
|
|
||||
5 | #[task(binds = UART0)]
|
||||
| ^^^^^
|
||||
9
macros/ui/task-divergent.rs
Normal file
9
macros/ui/task-divergent.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[task]
|
||||
fn foo(_: foo::Context) -> ! {
|
||||
loop {}
|
||||
}
|
||||
}
|
||||
5
macros/ui/task-divergent.stderr
Normal file
5
macros/ui/task-divergent.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: this task handler must have type signature `(async) fn(foo::Context, ..)`
|
||||
--> ui/task-divergent.rs:6:8
|
||||
|
|
||||
6 | fn foo(_: foo::Context) -> ! {
|
||||
| ^^^
|
||||
7
macros/ui/task-double-capacity.rs
Normal file
7
macros/ui/task-double-capacity.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[task(capacity = 1, capacity = 2)]
|
||||
fn foo(_: foo::Context) {}
|
||||
}
|
||||
5
macros/ui/task-double-capacity.stderr
Normal file
5
macros/ui/task-double-capacity.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: argument appears more than once
|
||||
--> $DIR/task-double-capacity.rs:5:26
|
||||
|
|
||||
5 | #[task(capacity = 1, capacity = 2)]
|
||||
| ^^^^^^^^
|
||||
7
macros/ui/task-double-local.rs
Normal file
7
macros/ui/task-double-local.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[task(local = [A], local = [B])]
|
||||
fn foo(_: foo::Context) {}
|
||||
}
|
||||
5
macros/ui/task-double-local.stderr
Normal file
5
macros/ui/task-double-local.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: argument appears more than once
|
||||
--> $DIR/task-double-local.rs:5:25
|
||||
|
|
||||
5 | #[task(local = [A], local = [B])]
|
||||
| ^^^^^
|
||||
7
macros/ui/task-double-priority.rs
Normal file
7
macros/ui/task-double-priority.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic_macros::mock_app(device = mock)]
|
||||
mod app {
|
||||
#[task(priority = 1, priority = 2)]
|
||||
fn foo(_: foo::Context) {}
|
||||
}
|
||||
5
macros/ui/task-double-priority.stderr
Normal file
5
macros/ui/task-double-priority.stderr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
error: argument appears more than once
|
||||
--> $DIR/task-double-priority.rs:5:26
|
||||
|
|
||||
5 | #[task(priority = 1, priority = 2)]
|
||||
| ^^^^^^^^
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue