Skip to content

Commit 8bb40d0

Browse files
committed
samples: rust: blinky: Use conditional imports to fix compiler warnings
1 parent 161825c commit 8bb40d0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

samples/blinky/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010

1111
use log::warn;
1212

13-
use zephyr::raw::ZR_GPIO_OUTPUT_ACTIVE;
14-
use zephyr::time::{sleep, Duration};
15-
1613
#[no_mangle]
1714
extern "C" fn rust_main() {
1815
unsafe {
@@ -26,6 +23,9 @@ extern "C" fn rust_main() {
2623

2724
#[cfg(dt = "aliases::led0")]
2825
fn do_blink() {
26+
use zephyr::raw::ZR_GPIO_OUTPUT_ACTIVE;
27+
use zephyr::time::{sleep, Duration};
28+
2929
warn!("Inside of blinky");
3030

3131
let mut led0 = zephyr::devicetree::aliases::led0::get_instance().unwrap();

0 commit comments

Comments
 (0)