From 21e4cd5994f85e2244d24c122a4dbad961bf87ad Mon Sep 17 00:00:00 2001 From: tinegachris Date: Sun, 21 Sep 2025 21:10:50 +0300 Subject: [PATCH] samples: rust: blinky: Use conditional imports to fix compiler warnings Signed-off-by: Chrispine Tinega --- samples/blinky/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/blinky/src/lib.rs b/samples/blinky/src/lib.rs index 4496a3b..0c46bd3 100644 --- a/samples/blinky/src/lib.rs +++ b/samples/blinky/src/lib.rs @@ -10,9 +10,6 @@ use log::warn; -use zephyr::raw::ZR_GPIO_OUTPUT_ACTIVE; -use zephyr::time::{sleep, Duration}; - #[no_mangle] extern "C" fn rust_main() { unsafe { @@ -26,6 +23,9 @@ extern "C" fn rust_main() { #[cfg(dt = "aliases::led0")] fn do_blink() { + use zephyr::raw::ZR_GPIO_OUTPUT_ACTIVE; + use zephyr::time::{sleep, Duration}; + warn!("Inside of blinky"); let mut led0 = zephyr::devicetree::aliases::led0::get_instance().unwrap();