aboutsummaryrefslogtreecommitdiff
path: root/examples/t-cfg.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--examples/t-cfg.rs (renamed from tests/cpass/cfg.rs)21
1 files changed, 10 insertions, 11 deletions
diff --git a/tests/cpass/cfg.rs b/examples/t-cfg.rs
index a0b6a870..e61ec795 100644
--- a/tests/cpass/cfg.rs
+++ b/examples/t-cfg.rs
@@ -1,18 +1,17 @@
-//! Compile-pass test that checks that `#[cfg]` attributes are respected
+//! [compile-pass] check that `#[cfg]` attributes are respected
-#![deny(unsafe_code)]
-#![deny(warnings)]
#![no_main]
#![no_std]
-extern crate lm3s6965;
-extern crate panic_halt;
-extern crate rtfm;
+use panic_halt as _;
-#[rtfm::app(device = lm3s6965)]
+#[rtfm::app(device = lm3s6965, monotonic = rtfm::cyccnt::CYCCNT)]
const APP: () = {
- #[cfg(never)]
- static mut FOO: u32 = 0;
+ struct Resources {
+ #[cfg(never)]
+ #[init(0)]
+ foo: u32,
+ }
#[init]
fn init(_: init::Context) {
@@ -28,13 +27,13 @@ const APP: () = {
loop {}
}
- #[task(resources = [FOO], schedule = [quux], spawn = [quux])]
+ #[task(resources = [foo], schedule = [quux], spawn = [quux])]
fn foo(_: foo::Context) {
#[cfg(never)]
static mut BAR: u32 = 0;
}
- #[task(priority = 3, resources = [FOO], schedule = [quux], spawn = [quux])]
+ #[task(priority = 3, resources = [foo], schedule = [quux], spawn = [quux])]
fn bar(_: bar::Context) {
#[cfg(never)]
static mut BAR: u32 = 0;