From 800904a1054639a090ef92e9b1e7c884ea9863e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= Date: Sun, 22 Jan 2023 13:11:29 +0100 Subject: Handle more cfgs, support cfg on HW/SW tasks --- examples/cfg-whole-task.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'examples') diff --git a/examples/cfg-whole-task.rs b/examples/cfg-whole-task.rs index b5b9783..17f31f4 100644 --- a/examples/cfg-whole-task.rs +++ b/examples/cfg-whole-task.rs @@ -82,6 +82,19 @@ mod app { // .. } + // The whole task should disappear, + // currently still present in the Tasks enum + #[cfg(never)] + #[task(binds = UART1, shared = [count])] + fn foo3(mut _cx: foo3::Context) { + #[cfg(debug_assertions)] + { + _cx.shared.count.lock(|count| *count += 10); + + log::spawn(_cx.shared.count.lock(|count| *count)).unwrap(); + } + } + #[cfg(debug_assertions)] #[task(capacity = 2)] fn log(_: log::Context, n: u32) { -- cgit v1.2.3