diff options
| author | James Munns <[email protected]> | 2025-11-29 16:07:30 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-11-29 16:07:30 +0100 |
| commit | 3b239cb6de22b7bb8c2d87defb3205294653be7a (patch) | |
| tree | 36690f9553c2e37007c6a61c40d919e3ad2c8c94 /examples/src/bin/button.rs | |
| parent | 87c4eaf3380505ca15ef7ed1d5dc435e9af2200e (diff) | |
Remove Drive/Slew settings for Input pin (#57)
* Don't set slew+strength for inputs
* Update example
Diffstat (limited to 'examples/src/bin/button.rs')
| -rw-r--r-- | examples/src/bin/button.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/src/bin/button.rs b/examples/src/bin/button.rs index 2abfe0a9f..943edbb15 100644 --- a/examples/src/bin/button.rs +++ b/examples/src/bin/button.rs | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | use embassy_executor::Spawner; | 4 | use embassy_executor::Spawner; |
| 5 | use embassy_time::Timer; | 5 | use embassy_time::Timer; |
| 6 | use hal::gpio::{DriveStrength, Input, Pull, SlewRate}; | 6 | use hal::gpio::{Input, Pull}; |
| 7 | use {defmt_rtt as _, embassy_mcxa as hal, panic_probe as _}; | 7 | use {defmt_rtt as _, embassy_mcxa as hal, panic_probe as _}; |
| 8 | 8 | ||
| 9 | #[embassy_executor::main] | 9 | #[embassy_executor::main] |
| @@ -12,7 +12,9 @@ async fn main(_spawner: Spawner) { | |||
| 12 | 12 | ||
| 13 | defmt::info!("Button example"); | 13 | defmt::info!("Button example"); |
| 14 | 14 | ||
| 15 | let monitor = Input::new(p.P1_7, Pull::Disabled, DriveStrength::Normal, SlewRate::Slow); | 15 | // This button is labeled "WAKEUP" on the FRDM-MCXA276 |
| 16 | // The board already has a 10K pullup | ||
| 17 | let monitor = Input::new(p.P1_7, Pull::Disabled); | ||
| 16 | 18 | ||
| 17 | loop { | 19 | loop { |
| 18 | defmt::info!("Pin level is {:?}", monitor.get_level()); | 20 | defmt::info!("Pin level is {:?}", monitor.get_level()); |
