Skip to content

Commit c2fb350

Browse files
committed
Add feature to opt-in the Badger2040W wiring that uses GPIO 22 for the LED
To see the blinking led on a Badger 2040W, run: $ cargo run --release --features wifi --example badger_blinky
1 parent eaa0b90 commit c2fb350

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Diff for: boards/pimoroni_badger2040/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,6 @@ disable-intrinsics = ["rp2040-hal/disable-intrinsics"]
4646

4747
# This enables ROM functions for f64 math that were not present in the earliest RP2040s
4848
rom-v2-intrinsics = ["rp2040-hal/rom-v2-intrinsics"]
49+
50+
# Define a feature to toggle between Badger2040 and Badger2040W
51+
wifi = []

Diff for: boards/pimoroni_badger2040/src/lib.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,13 @@ hal::bsp_pins!(
8181
},
8282
Gpio20 { name: inky_dc },
8383
Gpio21 { name: inky_res },
84+
/// GPIO 22 is connected to activity LED of the badger2040W.
85+
#[cfg(feature = "wifi")] Gpio22 { name: led },
8486
Gpio23 { name: user_sw },
8587
/// GPIO 24 is connected to vbus_detect of the badger2040.
8688
Gpio24 { name: vbus_detect },
8789
/// GPIO 25 is connected to activity LED of the badger2040.
88-
Gpio25 { name: led },
90+
#[cfg(not(feature = "wifi"))] Gpio25 { name: led },
8991
Gpio26 { name: inky_busy },
9092
Gpio27 { name: vref_power },
9193
Gpio28 { name: vref_1v24 },

0 commit comments

Comments
 (0)