Skip to content

Commit

Permalink
Add feature to opt-in the Badger2040W wiring that uses GPIO 22 for th…
Browse files Browse the repository at this point in the history
…e LED

To see the blinking led on a Badger 2040W, run:

$ cargo run --release --features wifi --example badger_blinky
  • Loading branch information
naufraghi committed Dec 29, 2024
1 parent eaa0b90 commit 64d6d28
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions boards/pimoroni_badger2040/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
2 changes: 1 addition & 1 deletion boards/pimoroni_badger2040/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 3 additions & 1 deletion boards/pimoroni_badger2040/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down

0 comments on commit 64d6d28

Please sign in to comment.