Skip to content

Conversation

tinegachris
Copy link

Summary

This PR fixes compiler warnings in the Rust blinky sample by moving imports inside the conditional compilation blocks where they are actually used.

Problem

When building the blinky sample for targets without an led0 device tree alias (like qemu_riscv32), the compiler generates warnings about unused imports:

Solution

Move the imports (ZR_GPIO_OUTPUT_ACTIVE, sleep, Duration) inside the #[cfg(dt = "aliases::led0")] conditional block where they are actually used.

Changes Made

  • Moved use zephyr::raw::ZR_GPIO_OUTPUT_ACTIVE; inside #[cfg(dt = "aliases::led0")] block
  • Moved use zephyr::time::{sleep, Duration}; inside #[cfg(dt = "aliases::led0")] block
  • No functional changes to the logic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant