test RFC 147

This commit is contained in:
Jorge Aparicio 2019-04-21 20:20:33 +02:00
parent d0aaa2a805
commit d538f5b17c
5 changed files with 93 additions and 0 deletions

View file

@ -0,0 +1,18 @@
#![no_main]
#![no_std]
extern crate lm3s6965;
extern crate panic_halt;
extern crate rtfm;
use rtfm::app;
#[app(device = lm3s6965)]
const APP: () = {
#[init]
fn init(_: init::Context) {}
#[exception(binds = SVCall)]
unsafe fn foo(_: foo::Context) {}
//~^ ERROR this `exception` handler must have type signature `fn(foo::Context)`
};

View file

@ -0,0 +1,20 @@
#![no_main]
#![no_std]
extern crate lm3s6965;
extern crate panic_halt;
extern crate rtfm;
use rtfm::app;
#[app(device = lm3s6965)]
const APP: () = {
#[init]
fn init(_: init::Context) {}
#[idle]
unsafe fn idle(_: idle::Context) -> ! {
//~^ ERROR `idle` must have type signature `fn(idle::Context) -> !`
loop {}
}
};

View file

@ -0,0 +1,15 @@
#![no_main]
#![no_std]
extern crate lm3s6965;
extern crate panic_halt;
extern crate rtfm;
use rtfm::app;
#[app(device = lm3s6965)]
const APP: () = {
#[init]
unsafe fn init(_: init::Context) {}
//~^ ERROR `init` must have type signature `fn(init::Context) [-> init::LateResources]`
};

View file

@ -0,0 +1,18 @@
#![no_main]
#![no_std]
extern crate lm3s6965;
extern crate panic_halt;
extern crate rtfm;
use rtfm::app;
#[app(device = lm3s6965)]
const APP: () = {
#[init]
fn init(_: init::Context) {}
#[interrupt(binds = UART0)]
unsafe fn foo(_: foo::Context) {}
//~^ ERROR this `interrupt` handler must have type signature `fn(foo::Context)`
};

View file

@ -0,0 +1,22 @@
#![no_main]
#![no_std]
extern crate lm3s6965;
extern crate panic_halt;
extern crate rtfm;
use rtfm::app;
#[app(device = lm3s6965)]
const APP: () = {
#[init]
fn init(_: init::Context) {}
#[task]
unsafe fn foo(_: foo::Context) {}
//~^ ERROR this `task` handler must have type signature `fn(foo::Context, ..)`
extern "C" {
fn UART0();
}
};