diff --git a/boards/pimoroni_badger2040/Cargo.toml b/boards/pimoroni_badger2040/Cargo.toml index f18b8f9b..c9492d63 100644 --- a/boards/pimoroni_badger2040/Cargo.toml +++ b/boards/pimoroni_badger2040/Cargo.toml @@ -46,3 +46,6 @@ disable-intrinsics = ["rp2040-hal/disable-intrinsics"] # This enables ROM functions for f64 math that were not present in the earliest RP2040s rom-v2-intrinsics = ["rp2040-hal/rom-v2-intrinsics"] + +# Define a feature to toggle between Badger2040 and Badger2040W +wifi = [] diff --git a/boards/pimoroni_badger2040/README.md b/boards/pimoroni_badger2040/README.md index e3079418..175f1d5d 100644 --- a/boards/pimoroni_badger2040/README.md +++ b/boards/pimoroni_badger2040/README.md @@ -57,7 +57,7 @@ then try repeating the `cargo run` command above. ### [badger_blinky](./examples/badger_blinky.rs) -Flashes the Badger2040's activity LED on and off. +Flashes the Badger2040's activity LED on and off. Use `--features=wifi` to run the Badger2040W version. ## Contributing diff --git a/boards/pimoroni_badger2040/src/lib.rs b/boards/pimoroni_badger2040/src/lib.rs index de66d394..5cf000fe 100644 --- a/boards/pimoroni_badger2040/src/lib.rs +++ b/boards/pimoroni_badger2040/src/lib.rs @@ -81,11 +81,13 @@ hal::bsp_pins!( }, Gpio20 { name: inky_dc }, Gpio21 { name: inky_res }, + /// GPIO 22 is connected to activity LED of the badger2040W. + #[cfg(feature = "wifi")] Gpio22 { name: led }, Gpio23 { name: user_sw }, /// GPIO 24 is connected to vbus_detect of the badger2040. Gpio24 { name: vbus_detect }, /// GPIO 25 is connected to activity LED of the badger2040. - Gpio25 { name: led }, + #[cfg(not(feature = "wifi"))] Gpio25 { name: led }, Gpio26 { name: inky_busy }, Gpio27 { name: vref_power }, Gpio28 { name: vref_1v24 }, diff --git a/boards/rp-pico/src/lib.rs b/boards/rp-pico/src/lib.rs index fc7602a8..f00707af 100644 --- a/boards/rp-pico/src/lib.rs +++ b/boards/rp-pico/src/lib.rs @@ -54,7 +54,6 @@ extern crate cortex_m_rt; /// loop {} /// } /// ``` - #[cfg(feature = "rt")] pub use hal::entry;