diff --git a/Cargo.toml b/Cargo.toml index 8f532d6..6449313 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -74,3 +74,8 @@ debug-assertions = false incremental = false lto = 'fat' opt-level = 3 + +[features] +default = ["pro_micro_rp2040"] +rp2040 = [] +pro_micro_rp2040 = [] diff --git a/src/main.rs b/src/main.rs index cba6611..cb35332 100644 --- a/src/main.rs +++ b/src/main.rs @@ -62,9 +62,12 @@ fn main() -> ! { // If you have a Pico W and want to toggle a LED with a simple GPIO output pin, you can connect an external // LED to one of the GPIO pins, and reference that pin here. Don't forget adding an appropriate resistor // in series with the LED. - // let mut led_pin = pins.led.into_push_pull_output(); + #[cfg(feature = "rp2040")] + let mut led_pin = pins.led.into_push_pull_output(); // In this case gpio17 is the led pin(for Pro Micro RP2040 16MB) + #[cfg(feature = "pro_micro_rp2040")] let mut led_pin = pins.gpio17.into_push_pull_output(); + loop { info!("on!"); led_pin.set_high().unwrap();