rtic/examples/t-binds.rs

33 lines
586 B
Rust
Raw Normal View History

//! [compile-pass] Check that `binds` works as advertised
2019-04-21 20:13:15 +02:00
#![deny(unsafe_code)]
#![deny(warnings)]
2019-02-23 21:50:52 +01:00
#![no_main]
#![no_std]
use panic_halt as _;
2019-02-23 21:50:52 +01:00
2020-06-11 19:18:29 +02:00
#[rtic::app(device = lm3s6965)]
2020-04-22 12:58:14 +02:00
mod APP {
2019-02-23 21:50:52 +01:00
#[init]
2019-04-21 20:13:15 +02:00
fn init(_: init::Context) {}
2019-02-23 21:50:52 +01:00
2019-06-20 06:19:59 +02:00
// Cortex-M exception
#[task(binds = SVCall)]
2019-04-21 20:13:15 +02:00
fn foo(c: foo::Context) {
foo_trampoline(c)
}
2019-02-23 21:50:52 +01:00
2019-06-20 06:19:59 +02:00
// LM3S6965 interrupt
#[task(binds = UART0)]
2019-04-21 20:13:15 +02:00
fn bar(c: bar::Context) {
bar_trampoline(c)
}
2020-04-22 12:58:14 +02:00
}
2019-02-23 21:50:52 +01:00
2019-02-23 21:56:05 +01:00
#[allow(dead_code)]
2019-02-23 21:50:52 +01:00
fn foo_trampoline(_: foo::Context) {}
2019-02-23 21:56:05 +01:00
#[allow(dead_code)]
2019-02-23 21:50:52 +01:00
fn bar_trampoline(_: bar::Context) {}