diff options
| author | Dario Nieuwenhuis <[email protected]> | 2024-01-22 20:44:57 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-01-22 20:44:57 +0000 |
| commit | c1ba008be457cdc8fe083fe36e380aa60dd784e2 (patch) | |
| tree | caabf0c20ce7d2d07e292690b1afb9baa606610f /examples/boot | |
| parent | 20fd03a14f1261e7b2264dcbca8e164393e66b94 (diff) | |
| parent | ee0ebe3121e5d51240e671d8c5cc19ad878b9db9 (diff) | |
Merge pull request #2471 from embassy-rs/remove-gpio-generics
gpio: remove generics.
Diffstat (limited to 'examples/boot')
| -rw-r--r-- | examples/boot/.cargo/config.toml | 4 | ||||
| -rw-r--r-- | examples/boot/application/rp/.cargo/config.toml | 4 | ||||
| -rw-r--r-- | examples/boot/application/stm32f3/src/bin/a.rs | 5 | ||||
| -rw-r--r-- | examples/boot/application/stm32f7/src/bin/a.rs | 5 | ||||
| -rw-r--r-- | examples/boot/application/stm32h7/src/bin/a.rs | 5 | ||||
| -rw-r--r-- | examples/boot/application/stm32l0/src/bin/a.rs | 5 | ||||
| -rw-r--r-- | examples/boot/application/stm32l1/src/bin/a.rs | 5 | ||||
| -rw-r--r-- | examples/boot/application/stm32l4/src/bin/a.rs | 5 | ||||
| -rw-r--r-- | examples/boot/application/stm32wl/src/bin/a.rs | 5 | ||||
| -rw-r--r-- | examples/boot/bootloader/nrf/.cargo/config.toml | 6 |
10 files changed, 21 insertions, 28 deletions
diff --git a/examples/boot/.cargo/config.toml b/examples/boot/.cargo/config.toml index de3a814f7..be1b73e45 100644 --- a/examples/boot/.cargo/config.toml +++ b/examples/boot/.cargo/config.toml | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | [unstable] | 1 | [unstable] |
| 2 | build-std = ["core"] | 2 | #build-std = ["core"] |
| 3 | build-std-features = ["panic_immediate_abort"] | 3 | #build-std-features = ["panic_immediate_abort"] |
| 4 | 4 | ||
| 5 | [build] | 5 | [build] |
| 6 | target = "thumbv7em-none-eabi" | 6 | target = "thumbv7em-none-eabi" |
diff --git a/examples/boot/application/rp/.cargo/config.toml b/examples/boot/application/rp/.cargo/config.toml index cd8d1ef02..22ab3a5c1 100644 --- a/examples/boot/application/rp/.cargo/config.toml +++ b/examples/boot/application/rp/.cargo/config.toml | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | [unstable] | 1 | [unstable] |
| 2 | build-std = ["core"] | 2 | #build-std = ["core"] |
| 3 | build-std-features = ["panic_immediate_abort"] | 3 | #build-std-features = ["panic_immediate_abort"] |
| 4 | 4 | ||
| 5 | [target.'cfg(all(target_arch = "arm", target_os = "none"))'] | 5 | [target.'cfg(all(target_arch = "arm", target_os = "none"))'] |
| 6 | runner = "probe-rs run --chip RP2040" | 6 | runner = "probe-rs run --chip RP2040" |
diff --git a/examples/boot/application/stm32f3/src/bin/a.rs b/examples/boot/application/stm32f3/src/bin/a.rs index 96ae5c47b..3f9ebe5c8 100644 --- a/examples/boot/application/stm32f3/src/bin/a.rs +++ b/examples/boot/application/stm32f3/src/bin/a.rs | |||
| @@ -8,7 +8,7 @@ use embassy_embedded_hal::adapter::BlockingAsync; | |||
| 8 | use embassy_executor::Spawner; | 8 | use embassy_executor::Spawner; |
| 9 | use embassy_stm32::exti::ExtiInput; | 9 | use embassy_stm32::exti::ExtiInput; |
| 10 | use embassy_stm32::flash::{Flash, WRITE_SIZE}; | 10 | use embassy_stm32::flash::{Flash, WRITE_SIZE}; |
| 11 | use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; | 11 | use embassy_stm32::gpio::{Level, Output, Pull, Speed}; |
| 12 | use embassy_sync::mutex::Mutex; | 12 | use embassy_sync::mutex::Mutex; |
| 13 | use panic_reset as _; | 13 | use panic_reset as _; |
| 14 | 14 | ||
| @@ -23,8 +23,7 @@ async fn main(_spawner: Spawner) { | |||
| 23 | let flash = Flash::new_blocking(p.FLASH); | 23 | let flash = Flash::new_blocking(p.FLASH); |
| 24 | let flash = Mutex::new(BlockingAsync::new(flash)); | 24 | let flash = Mutex::new(BlockingAsync::new(flash)); |
| 25 | 25 | ||
| 26 | let button = Input::new(p.PC13, Pull::Up); | 26 | let mut button = ExtiInput::new(p.PC13, p.EXTI13, Pull::Up); |
| 27 | let mut button = ExtiInput::new(button, p.EXTI13); | ||
| 28 | 27 | ||
| 29 | let mut led = Output::new(p.PA5, Level::Low, Speed::Low); | 28 | let mut led = Output::new(p.PA5, Level::Low, Speed::Low); |
| 30 | led.set_high(); | 29 | led.set_high(); |
diff --git a/examples/boot/application/stm32f7/src/bin/a.rs b/examples/boot/application/stm32f7/src/bin/a.rs index a6107386a..c57c29263 100644 --- a/examples/boot/application/stm32f7/src/bin/a.rs +++ b/examples/boot/application/stm32f7/src/bin/a.rs | |||
| @@ -9,7 +9,7 @@ use embassy_boot_stm32::{AlignedBuffer, BlockingFirmwareUpdater, FirmwareUpdater | |||
| 9 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| 10 | use embassy_stm32::exti::ExtiInput; | 10 | use embassy_stm32::exti::ExtiInput; |
| 11 | use embassy_stm32::flash::{Flash, WRITE_SIZE}; | 11 | use embassy_stm32::flash::{Flash, WRITE_SIZE}; |
| 12 | use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; | 12 | use embassy_stm32::gpio::{Level, Output, Pull, Speed}; |
| 13 | use embassy_sync::blocking_mutex::Mutex; | 13 | use embassy_sync::blocking_mutex::Mutex; |
| 14 | use embedded_storage::nor_flash::NorFlash; | 14 | use embedded_storage::nor_flash::NorFlash; |
| 15 | use panic_reset as _; | 15 | use panic_reset as _; |
| @@ -25,8 +25,7 @@ async fn main(_spawner: Spawner) { | |||
| 25 | let flash = Flash::new_blocking(p.FLASH); | 25 | let flash = Flash::new_blocking(p.FLASH); |
| 26 | let flash = Mutex::new(RefCell::new(flash)); | 26 | let flash = Mutex::new(RefCell::new(flash)); |
| 27 | 27 | ||
| 28 | let button = Input::new(p.PC13, Pull::Down); | 28 | let mut button = ExtiInput::new(p.PC13, p.EXTI13, Pull::Down); |
| 29 | let mut button = ExtiInput::new(button, p.EXTI13); | ||
| 30 | 29 | ||
| 31 | let mut led = Output::new(p.PB7, Level::Low, Speed::Low); | 30 | let mut led = Output::new(p.PB7, Level::Low, Speed::Low); |
| 32 | led.set_high(); | 31 | led.set_high(); |
diff --git a/examples/boot/application/stm32h7/src/bin/a.rs b/examples/boot/application/stm32h7/src/bin/a.rs index b73506cf3..a00d17408 100644 --- a/examples/boot/application/stm32h7/src/bin/a.rs +++ b/examples/boot/application/stm32h7/src/bin/a.rs | |||
| @@ -9,7 +9,7 @@ use embassy_boot_stm32::{AlignedBuffer, BlockingFirmwareUpdater, FirmwareUpdater | |||
| 9 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| 10 | use embassy_stm32::exti::ExtiInput; | 10 | use embassy_stm32::exti::ExtiInput; |
| 11 | use embassy_stm32::flash::{Flash, WRITE_SIZE}; | 11 | use embassy_stm32::flash::{Flash, WRITE_SIZE}; |
| 12 | use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; | 12 | use embassy_stm32::gpio::{Level, Output, Pull, Speed}; |
| 13 | use embassy_sync::blocking_mutex::Mutex; | 13 | use embassy_sync::blocking_mutex::Mutex; |
| 14 | use embedded_storage::nor_flash::NorFlash; | 14 | use embedded_storage::nor_flash::NorFlash; |
| 15 | use panic_reset as _; | 15 | use panic_reset as _; |
| @@ -25,8 +25,7 @@ async fn main(_spawner: Spawner) { | |||
| 25 | let flash = Flash::new_blocking(p.FLASH); | 25 | let flash = Flash::new_blocking(p.FLASH); |
| 26 | let flash = Mutex::new(RefCell::new(flash)); | 26 | let flash = Mutex::new(RefCell::new(flash)); |
| 27 | 27 | ||
| 28 | let button = Input::new(p.PC13, Pull::Down); | 28 | let mut button = ExtiInput::new(p.PC13, p.EXTI13, Pull::Down); |
| 29 | let mut button = ExtiInput::new(button, p.EXTI13); | ||
| 30 | 29 | ||
| 31 | let mut led = Output::new(p.PB14, Level::Low, Speed::Low); | 30 | let mut led = Output::new(p.PB14, Level::Low, Speed::Low); |
| 32 | led.set_high(); | 31 | led.set_high(); |
diff --git a/examples/boot/application/stm32l0/src/bin/a.rs b/examples/boot/application/stm32l0/src/bin/a.rs index 02f74bdef..dbec49d44 100644 --- a/examples/boot/application/stm32l0/src/bin/a.rs +++ b/examples/boot/application/stm32l0/src/bin/a.rs | |||
| @@ -8,7 +8,7 @@ use embassy_embedded_hal::adapter::BlockingAsync; | |||
| 8 | use embassy_executor::Spawner; | 8 | use embassy_executor::Spawner; |
| 9 | use embassy_stm32::exti::ExtiInput; | 9 | use embassy_stm32::exti::ExtiInput; |
| 10 | use embassy_stm32::flash::{Flash, WRITE_SIZE}; | 10 | use embassy_stm32::flash::{Flash, WRITE_SIZE}; |
| 11 | use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; | 11 | use embassy_stm32::gpio::{Level, Output, Pull, Speed}; |
| 12 | use embassy_sync::mutex::Mutex; | 12 | use embassy_sync::mutex::Mutex; |
| 13 | use embassy_time::Timer; | 13 | use embassy_time::Timer; |
| 14 | use panic_reset as _; | 14 | use panic_reset as _; |
| @@ -24,8 +24,7 @@ async fn main(_spawner: Spawner) { | |||
| 24 | let flash = Flash::new_blocking(p.FLASH); | 24 | let flash = Flash::new_blocking(p.FLASH); |
| 25 | let flash = Mutex::new(BlockingAsync::new(flash)); | 25 | let flash = Mutex::new(BlockingAsync::new(flash)); |
| 26 | 26 | ||
| 27 | let button = Input::new(p.PB2, Pull::Up); | 27 | let mut button = ExtiInput::new(p.PB2, p.EXTI2, Pull::Up); |
| 28 | let mut button = ExtiInput::new(button, p.EXTI2); | ||
| 29 | 28 | ||
| 30 | let mut led = Output::new(p.PB5, Level::Low, Speed::Low); | 29 | let mut led = Output::new(p.PB5, Level::Low, Speed::Low); |
| 31 | 30 | ||
diff --git a/examples/boot/application/stm32l1/src/bin/a.rs b/examples/boot/application/stm32l1/src/bin/a.rs index 02f74bdef..dbec49d44 100644 --- a/examples/boot/application/stm32l1/src/bin/a.rs +++ b/examples/boot/application/stm32l1/src/bin/a.rs | |||
| @@ -8,7 +8,7 @@ use embassy_embedded_hal::adapter::BlockingAsync; | |||
| 8 | use embassy_executor::Spawner; | 8 | use embassy_executor::Spawner; |
| 9 | use embassy_stm32::exti::ExtiInput; | 9 | use embassy_stm32::exti::ExtiInput; |
| 10 | use embassy_stm32::flash::{Flash, WRITE_SIZE}; | 10 | use embassy_stm32::flash::{Flash, WRITE_SIZE}; |
| 11 | use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; | 11 | use embassy_stm32::gpio::{Level, Output, Pull, Speed}; |
| 12 | use embassy_sync::mutex::Mutex; | 12 | use embassy_sync::mutex::Mutex; |
| 13 | use embassy_time::Timer; | 13 | use embassy_time::Timer; |
| 14 | use panic_reset as _; | 14 | use panic_reset as _; |
| @@ -24,8 +24,7 @@ async fn main(_spawner: Spawner) { | |||
| 24 | let flash = Flash::new_blocking(p.FLASH); | 24 | let flash = Flash::new_blocking(p.FLASH); |
| 25 | let flash = Mutex::new(BlockingAsync::new(flash)); | 25 | let flash = Mutex::new(BlockingAsync::new(flash)); |
| 26 | 26 | ||
| 27 | let button = Input::new(p.PB2, Pull::Up); | 27 | let mut button = ExtiInput::new(p.PB2, p.EXTI2, Pull::Up); |
| 28 | let mut button = ExtiInput::new(button, p.EXTI2); | ||
| 29 | 28 | ||
| 30 | let mut led = Output::new(p.PB5, Level::Low, Speed::Low); | 29 | let mut led = Output::new(p.PB5, Level::Low, Speed::Low); |
| 31 | 30 | ||
diff --git a/examples/boot/application/stm32l4/src/bin/a.rs b/examples/boot/application/stm32l4/src/bin/a.rs index 892446968..e946c3cdf 100644 --- a/examples/boot/application/stm32l4/src/bin/a.rs +++ b/examples/boot/application/stm32l4/src/bin/a.rs | |||
| @@ -8,7 +8,7 @@ use embassy_embedded_hal::adapter::BlockingAsync; | |||
| 8 | use embassy_executor::Spawner; | 8 | use embassy_executor::Spawner; |
| 9 | use embassy_stm32::exti::ExtiInput; | 9 | use embassy_stm32::exti::ExtiInput; |
| 10 | use embassy_stm32::flash::{Flash, WRITE_SIZE}; | 10 | use embassy_stm32::flash::{Flash, WRITE_SIZE}; |
| 11 | use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; | 11 | use embassy_stm32::gpio::{Level, Output, Pull, Speed}; |
| 12 | use embassy_sync::mutex::Mutex; | 12 | use embassy_sync::mutex::Mutex; |
| 13 | use panic_reset as _; | 13 | use panic_reset as _; |
| 14 | 14 | ||
| @@ -23,8 +23,7 @@ async fn main(_spawner: Spawner) { | |||
| 23 | let flash = Flash::new_blocking(p.FLASH); | 23 | let flash = Flash::new_blocking(p.FLASH); |
| 24 | let flash = Mutex::new(BlockingAsync::new(flash)); | 24 | let flash = Mutex::new(BlockingAsync::new(flash)); |
| 25 | 25 | ||
| 26 | let button = Input::new(p.PC13, Pull::Up); | 26 | let mut button = ExtiInput::new(p.PC13, p.EXTI13, Pull::Up); |
| 27 | let mut button = ExtiInput::new(button, p.EXTI13); | ||
| 28 | 27 | ||
| 29 | let mut led = Output::new(p.PB14, Level::Low, Speed::Low); | 28 | let mut led = Output::new(p.PB14, Level::Low, Speed::Low); |
| 30 | led.set_high(); | 29 | led.set_high(); |
diff --git a/examples/boot/application/stm32wl/src/bin/a.rs b/examples/boot/application/stm32wl/src/bin/a.rs index d9665e6ee..b582d8b25 100644 --- a/examples/boot/application/stm32wl/src/bin/a.rs +++ b/examples/boot/application/stm32wl/src/bin/a.rs | |||
| @@ -8,7 +8,7 @@ use embassy_embedded_hal::adapter::BlockingAsync; | |||
| 8 | use embassy_executor::Spawner; | 8 | use embassy_executor::Spawner; |
| 9 | use embassy_stm32::exti::ExtiInput; | 9 | use embassy_stm32::exti::ExtiInput; |
| 10 | use embassy_stm32::flash::{Flash, WRITE_SIZE}; | 10 | use embassy_stm32::flash::{Flash, WRITE_SIZE}; |
| 11 | use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; | 11 | use embassy_stm32::gpio::{Level, Output, Pull, Speed}; |
| 12 | use embassy_sync::mutex::Mutex; | 12 | use embassy_sync::mutex::Mutex; |
| 13 | use panic_reset as _; | 13 | use panic_reset as _; |
| 14 | 14 | ||
| @@ -23,8 +23,7 @@ async fn main(_spawner: Spawner) { | |||
| 23 | let flash = Flash::new_blocking(p.FLASH); | 23 | let flash = Flash::new_blocking(p.FLASH); |
| 24 | let flash = Mutex::new(BlockingAsync::new(flash)); | 24 | let flash = Mutex::new(BlockingAsync::new(flash)); |
| 25 | 25 | ||
| 26 | let button = Input::new(p.PA0, Pull::Up); | 26 | let mut button = ExtiInput::new(p.PA0, p.EXTI0, Pull::Up); |
| 27 | let mut button = ExtiInput::new(button, p.EXTI0); | ||
| 28 | 27 | ||
| 29 | let mut led = Output::new(p.PB9, Level::Low, Speed::Low); | 28 | let mut led = Output::new(p.PB9, Level::Low, Speed::Low); |
| 30 | led.set_high(); | 29 | led.set_high(); |
diff --git a/examples/boot/bootloader/nrf/.cargo/config.toml b/examples/boot/bootloader/nrf/.cargo/config.toml index c292846aa..58acd1a49 100644 --- a/examples/boot/bootloader/nrf/.cargo/config.toml +++ b/examples/boot/bootloader/nrf/.cargo/config.toml | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | [unstable] | 1 | [unstable] |
| 2 | build-std = ["core"] | 2 | #build-std = ["core"] |
| 3 | build-std-features = ["panic_immediate_abort"] | 3 | #build-std-features = ["panic_immediate_abort"] |
| 4 | 4 | ||
| 5 | [target.'cfg(all(target_arch = "arm", target_os = "none"))'] | 5 | [target.'cfg(all(target_arch = "arm", target_os = "none"))'] |
| 6 | #runner = "./fruitrunner" | 6 | #runner = "./fruitrunner" |
| @@ -8,7 +8,7 @@ runner = "probe-rs run --chip nrf52840_xxAA" | |||
| 8 | 8 | ||
| 9 | rustflags = [ | 9 | rustflags = [ |
| 10 | # Code-size optimizations. | 10 | # Code-size optimizations. |
| 11 | "-Z", "trap-unreachable=no", | 11 | #"-Z", "trap-unreachable=no", |
| 12 | #"-C", "no-vectorize-loops", | 12 | #"-C", "no-vectorize-loops", |
| 13 | "-C", "force-frame-pointers=yes", | 13 | "-C", "force-frame-pointers=yes", |
| 14 | ] | 14 | ] |
