This commit is contained in:
Jorge Aparicio 2019-06-20 06:19:59 +02:00
parent b150ab29e2
commit 4e51bb68b9
33 changed files with 143 additions and 142 deletions

View file

@ -2,6 +2,6 @@
#[rtfm::app(device = lm3s6965)]
const APP: () = {
#[exception]
fn NonMaskableInt(_: NonMaskableInt::Context) {}
#[task(binds = NonMaskableInt)]
fn nmi(_: nmi::Context) {}
};

View file

@ -1,8 +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) {}
| ^^^^^^^^^^^^^^
6 | fn nmi(_: nmi::Context) {}
| ^^^
error: aborting due to previous error

View file

@ -2,8 +2,8 @@
#[rtfm::app(device = lm3s6965)]
const APP: () = {
#[exception]
fn SysTick(_: SysTick::Context) {}
#[task(binds = SysTick)]
fn sys_tick(_: sys_tick::Context) {}
#[task(schedule = [foo])]
fn foo(_: foo::Context) {}

View file

@ -1,8 +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) {}
| ^^^^^^^
6 | fn sys_tick(_: sys_tick::Context) {}
| ^^^^^^^^
error: aborting due to previous error

View file

@ -2,7 +2,7 @@
#[rtfm::app(device = lm3s6965)]
const APP: () = {
#[interrupt(binds = UART0)]
#[task(binds = UART0)]
fn a(_: a::Context) {}
extern "C" {

View file

@ -1,8 +1,8 @@
error: `extern` interrupts can't be used as hardware tasks
--> $DIR/extern-interrupt-used.rs:5:25
--> $DIR/extern-interrupt-used.rs:5:20
|
5 | #[interrupt(binds = UART0)]
| ^^^^^
5 | #[task(binds = UART0)]
| ^^^^^
error: aborting due to previous error

View file

@ -20,16 +20,16 @@ const APP: () = {
loop {}
}
#[exception]
fn SVCall(_: SVCall::Context) {
#[task(binds = SVCall)]
fn svcall(_: svcall::Context) {
#[cfg(never)]
static mut FOO: u32 = 0;
FOO;
}
#[interrupt]
fn UART0(_: UART0::Context) {
#[task(binds = UART0)]
fn uart0(_: uart0::Context) {
#[cfg(never)]
static mut FOO: u32 = 0;

View file

@ -41,16 +41,16 @@ const APP: () = {
loop {}
}
#[interrupt(resources = [O3, S1, S2, S3])]
fn UART0(c: UART0::Context) {
#[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;
}
#[interrupt(resources = [S2, O5])]
fn UART1(c: UART1::Context) {
#[task(binds = UART1, resources = [S2, O5])]
fn uart1(c: uart1::Context) {
c.resources.S2;
c.resources.O5;
}

View file

@ -70,7 +70,7 @@ error[E0609]: no field `S3` on type `idleResources<'_>`
|
= note: available fields are: `__marker__`
error[E0609]: no field `O3` on type `UART0Resources<'_>`
error[E0609]: no field `O3` on type `uart0Resources<'_>`
--> $DIR/resources-cfg.rs:46:21
|
46 | c.resources.O3;
@ -78,7 +78,7 @@ error[E0609]: no field `O3` on type `UART0Resources<'_>`
|
= note: available fields are: `__marker__`
error[E0609]: no field `S1` on type `UART0Resources<'_>`
error[E0609]: no field `S1` on type `uart0Resources<'_>`
--> $DIR/resources-cfg.rs:47:21
|
47 | c.resources.S1;
@ -86,7 +86,7 @@ error[E0609]: no field `S1` on type `UART0Resources<'_>`
|
= note: available fields are: `__marker__`
error[E0609]: no field `S2` on type `UART0Resources<'_>`
error[E0609]: no field `S2` on type `uart0Resources<'_>`
--> $DIR/resources-cfg.rs:48:21
|
48 | c.resources.S2;
@ -94,7 +94,7 @@ error[E0609]: no field `S2` on type `UART0Resources<'_>`
|
= note: available fields are: `__marker__`
error[E0609]: no field `S3` on type `UART0Resources<'_>`
error[E0609]: no field `S3` on type `uart0Resources<'_>`
--> $DIR/resources-cfg.rs:49:21
|
49 | c.resources.S3;
@ -102,7 +102,7 @@ error[E0609]: no field `S3` on type `UART0Resources<'_>`
|
= note: available fields are: `__marker__`
error[E0609]: no field `S2` on type `UART1Resources<'_>`
error[E0609]: no field `S2` on type `uart1Resources<'_>`
--> $DIR/resources-cfg.rs:54:21
|
54 | c.resources.S2;
@ -110,7 +110,7 @@ error[E0609]: no field `S2` on type `UART1Resources<'_>`
|
= note: available fields are: `__marker__`
error[E0609]: no field `O5` on type `UART1Resources<'_>`
error[E0609]: no field `O5` on type `uart1Resources<'_>`
--> $DIR/resources-cfg.rs:55:21
|
55 | c.resources.O5;

View file

@ -7,32 +7,32 @@ const APP: () = {
#[init]
fn init(_: init::Context) {}
#[interrupt(priority = 1)]
fn GPIOA(_: GPIOA::Context) {}
#[task(binds = GPIOA, priority = 1)]
fn gpioa(_: gpioa::Context) {}
#[interrupt(priority = 2)]
fn GPIOB(_: GPIOB::Context) {}
#[task(binds = GPIOB, priority = 2)]
fn gpiob(_: gpiob::Context) {}
#[interrupt(priority = 3)]
fn GPIOC(_: GPIOC::Context) {}
#[task(binds = GPIOC, priority = 3)]
fn gpioc(_: gpioc::Context) {}
#[interrupt(priority = 4)]
fn GPIOD(_: GPIOD::Context) {}
#[task(binds = GPIOD, priority = 4)]
fn gpiod(_: gpiod::Context) {}
#[interrupt(priority = 5)]
fn GPIOE(_: GPIOE::Context) {}
#[task(binds = GPIOE, priority = 5)]
fn gpioe(_: gpioe::Context) {}
#[interrupt(priority = 6)]
fn UART0(_: UART0::Context) {}
#[task(binds = UART0, priority = 6)]
fn uart0(_: uart0::Context) {}
#[interrupt(priority = 7)]
fn UART1(_: UART1::Context) {}
#[task(binds = UART1, priority = 7)]
fn uart1(_: uart1::Context) {}
// OK, this is the maximum priority supported by the device
#[interrupt(priority = 8)]
fn SSI0(_: SSI0::Context) {}
#[task(binds = SSI0, priority = 8)]
fn ssi0(_: ssi0::Context) {}
// this value is too high!
#[interrupt(priority = 9)]
fn I2C0(_: I2C0::Context) {}
#[task(binds = I2C0, priority = 9)]
fn i2c0(_: i2c0::Context) {}
};