properly handle #[cfg] (conditional compilation) on tasks

This commit is contained in:
Jorge Aparicio 2018-12-16 19:10:36 +01:00
parent 4345c10596
commit 8e9a91d0b0
4 changed files with 72 additions and 20 deletions

View file

@ -30,18 +30,22 @@ const APP: () = {
loop {}
}
#[task(resources = [FOO])]
#[task(resources = [FOO], schedule = [quux], spawn = [quux])]
fn foo() {
#[cfg(never)]
static mut BAR: u32 = 0;
}
#[task(priority = 3, resources = [FOO])]
#[task(priority = 3, resources = [FOO], schedule = [quux], spawn = [quux])]
fn bar() {
#[cfg(never)]
static mut BAR: u32 = 0;
}
#[cfg(never)]
#[task]
fn quux() {}
extern "C" {
fn UART0();
fn UART1();