diff options
| author | Gustav Toft <[email protected]> | 2024-06-05 08:11:50 +0200 |
|---|---|---|
| committer | Gustav Toft <[email protected]> | 2024-06-05 08:11:50 +0200 |
| commit | 319e18b3997756942803cb1c10ae43327a4e3056 (patch) | |
| tree | 428f0d698d58dd569f9b3fb8b1ee47c2ca9a70a1 /examples | |
| parent | d3c3670a966cd68b8d2d46a732ab971390ec3006 (diff) | |
| parent | 5f9bc6def7ea8698a6ce45d8e12e1d1bd8cce876 (diff) | |
Merge branch 'main' of https://github.com/embassy-rs/embassy into fix_main
Diffstat (limited to 'examples')
43 files changed, 301 insertions, 35 deletions
diff --git a/examples/boot/application/nrf/Cargo.toml b/examples/boot/application/nrf/Cargo.toml index f0a710335..cf34bb7cf 100644 --- a/examples/boot/application/nrf/Cargo.toml +++ b/examples/boot/application/nrf/Cargo.toml | |||
| @@ -25,3 +25,10 @@ cortex-m-rt = "0.7.0" | |||
| 25 | ed25519-dalek = ["embassy-boot/ed25519-dalek"] | 25 | ed25519-dalek = ["embassy-boot/ed25519-dalek"] |
| 26 | ed25519-salty = ["embassy-boot/ed25519-salty"] | 26 | ed25519-salty = ["embassy-boot/ed25519-salty"] |
| 27 | skip-include = [] | 27 | skip-include = [] |
| 28 | defmt = [ | ||
| 29 | "dep:defmt", | ||
| 30 | "dep:defmt-rtt", | ||
| 31 | "embassy-nrf/defmt", | ||
| 32 | "embassy-boot-nrf/defmt", | ||
| 33 | "embassy-sync/defmt", | ||
| 34 | ] | ||
diff --git a/examples/boot/application/stm32f3/Cargo.toml b/examples/boot/application/stm32f3/Cargo.toml index fe1a6f5b1..9b79b01ce 100644 --- a/examples/boot/application/stm32f3/Cargo.toml +++ b/examples/boot/application/stm32f3/Cargo.toml | |||
| @@ -23,6 +23,7 @@ cortex-m-rt = "0.7.0" | |||
| 23 | [features] | 23 | [features] |
| 24 | defmt = [ | 24 | defmt = [ |
| 25 | "dep:defmt", | 25 | "dep:defmt", |
| 26 | "dep:defmt-rtt", | ||
| 26 | "embassy-stm32/defmt", | 27 | "embassy-stm32/defmt", |
| 27 | "embassy-boot-stm32/defmt", | 28 | "embassy-boot-stm32/defmt", |
| 28 | "embassy-sync/defmt", | 29 | "embassy-sync/defmt", |
diff --git a/examples/boot/application/stm32f3/src/bin/a.rs b/examples/boot/application/stm32f3/src/bin/a.rs index 8858ae3da..b608b2e01 100644 --- a/examples/boot/application/stm32f3/src/bin/a.rs +++ b/examples/boot/application/stm32f3/src/bin/a.rs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | 3 | ||
| 4 | #[cfg(feature = "defmt-rtt")] | 4 | #[cfg(feature = "defmt")] |
| 5 | use defmt_rtt::*; | 5 | use defmt_rtt::*; |
| 6 | use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater, FirmwareUpdaterConfig}; | 6 | use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater, FirmwareUpdaterConfig}; |
| 7 | use embassy_embedded_hal::adapter::BlockingAsync; | 7 | use embassy_embedded_hal::adapter::BlockingAsync; |
diff --git a/examples/boot/application/stm32f3/src/bin/b.rs b/examples/boot/application/stm32f3/src/bin/b.rs index 22ba82d5e..b1a505631 100644 --- a/examples/boot/application/stm32f3/src/bin/b.rs +++ b/examples/boot/application/stm32f3/src/bin/b.rs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | 3 | ||
| 4 | #[cfg(feature = "defmt-rtt")] | 4 | #[cfg(feature = "defmt")] |
| 5 | use defmt_rtt::*; | 5 | use defmt_rtt::*; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_stm32::gpio::{Level, Output, Speed}; | 7 | use embassy_stm32::gpio::{Level, Output, Speed}; |
diff --git a/examples/boot/application/stm32f7/Cargo.toml b/examples/boot/application/stm32f7/Cargo.toml index 37e362824..0167dfb76 100644 --- a/examples/boot/application/stm32f7/Cargo.toml +++ b/examples/boot/application/stm32f7/Cargo.toml | |||
| @@ -24,6 +24,7 @@ cortex-m-rt = "0.7.0" | |||
| 24 | [features] | 24 | [features] |
| 25 | defmt = [ | 25 | defmt = [ |
| 26 | "dep:defmt", | 26 | "dep:defmt", |
| 27 | "dep:defmt-rtt", | ||
| 27 | "embassy-stm32/defmt", | 28 | "embassy-stm32/defmt", |
| 28 | "embassy-boot-stm32/defmt", | 29 | "embassy-boot-stm32/defmt", |
| 29 | "embassy-sync/defmt", | 30 | "embassy-sync/defmt", |
diff --git a/examples/boot/application/stm32f7/src/bin/a.rs b/examples/boot/application/stm32f7/src/bin/a.rs index d3df11fe4..172b4c235 100644 --- a/examples/boot/application/stm32f7/src/bin/a.rs +++ b/examples/boot/application/stm32f7/src/bin/a.rs | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | use core::cell::RefCell; | 4 | use core::cell::RefCell; |
| 5 | 5 | ||
| 6 | #[cfg(feature = "defmt-rtt")] | 6 | #[cfg(feature = "defmt")] |
| 7 | use defmt_rtt::*; | 7 | use defmt_rtt::*; |
| 8 | use embassy_boot_stm32::{AlignedBuffer, BlockingFirmwareUpdater, FirmwareUpdaterConfig}; | 8 | use embassy_boot_stm32::{AlignedBuffer, BlockingFirmwareUpdater, FirmwareUpdaterConfig}; |
| 9 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
diff --git a/examples/boot/application/stm32f7/src/bin/b.rs b/examples/boot/application/stm32f7/src/bin/b.rs index 190477204..6bc9c9ab8 100644 --- a/examples/boot/application/stm32f7/src/bin/b.rs +++ b/examples/boot/application/stm32f7/src/bin/b.rs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | 3 | ||
| 4 | #[cfg(feature = "defmt-rtt")] | 4 | #[cfg(feature = "defmt")] |
| 5 | use defmt_rtt::*; | 5 | use defmt_rtt::*; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_stm32::gpio::{Level, Output, Speed}; | 7 | use embassy_stm32::gpio::{Level, Output, Speed}; |
diff --git a/examples/boot/application/stm32h7/Cargo.toml b/examples/boot/application/stm32h7/Cargo.toml index 52cd0b546..61643d485 100644 --- a/examples/boot/application/stm32h7/Cargo.toml +++ b/examples/boot/application/stm32h7/Cargo.toml | |||
| @@ -24,6 +24,7 @@ cortex-m-rt = "0.7.0" | |||
| 24 | [features] | 24 | [features] |
| 25 | defmt = [ | 25 | defmt = [ |
| 26 | "dep:defmt", | 26 | "dep:defmt", |
| 27 | "dep:defmt-rtt", | ||
| 27 | "embassy-stm32/defmt", | 28 | "embassy-stm32/defmt", |
| 28 | "embassy-boot-stm32/defmt", | 29 | "embassy-boot-stm32/defmt", |
| 29 | "embassy-sync/defmt", | 30 | "embassy-sync/defmt", |
diff --git a/examples/boot/application/stm32h7/src/bin/a.rs b/examples/boot/application/stm32h7/src/bin/a.rs index f61ac1f71..c1b1a267a 100644 --- a/examples/boot/application/stm32h7/src/bin/a.rs +++ b/examples/boot/application/stm32h7/src/bin/a.rs | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | use core::cell::RefCell; | 4 | use core::cell::RefCell; |
| 5 | 5 | ||
| 6 | #[cfg(feature = "defmt-rtt")] | 6 | #[cfg(feature = "defmt")] |
| 7 | use defmt_rtt::*; | 7 | use defmt_rtt::*; |
| 8 | use embassy_boot_stm32::{AlignedBuffer, BlockingFirmwareUpdater, FirmwareUpdaterConfig}; | 8 | use embassy_boot_stm32::{AlignedBuffer, BlockingFirmwareUpdater, FirmwareUpdaterConfig}; |
| 9 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
diff --git a/examples/boot/application/stm32h7/src/bin/b.rs b/examples/boot/application/stm32h7/src/bin/b.rs index 5f3f35207..13bdae1f1 100644 --- a/examples/boot/application/stm32h7/src/bin/b.rs +++ b/examples/boot/application/stm32h7/src/bin/b.rs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | 3 | ||
| 4 | #[cfg(feature = "defmt-rtt")] | 4 | #[cfg(feature = "defmt")] |
| 5 | use defmt_rtt::*; | 5 | use defmt_rtt::*; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_stm32::gpio::{Level, Output, Speed}; | 7 | use embassy_stm32::gpio::{Level, Output, Speed}; |
diff --git a/examples/boot/application/stm32l0/Cargo.toml b/examples/boot/application/stm32l0/Cargo.toml index 0f3cbe654..2990089ac 100644 --- a/examples/boot/application/stm32l0/Cargo.toml +++ b/examples/boot/application/stm32l0/Cargo.toml | |||
| @@ -23,6 +23,7 @@ cortex-m-rt = "0.7.0" | |||
| 23 | [features] | 23 | [features] |
| 24 | defmt = [ | 24 | defmt = [ |
| 25 | "dep:defmt", | 25 | "dep:defmt", |
| 26 | "dep:defmt-rtt", | ||
| 26 | "embassy-stm32/defmt", | 27 | "embassy-stm32/defmt", |
| 27 | "embassy-boot-stm32/defmt", | 28 | "embassy-boot-stm32/defmt", |
| 28 | "embassy-sync/defmt", | 29 | "embassy-sync/defmt", |
diff --git a/examples/boot/application/stm32l0/src/bin/a.rs b/examples/boot/application/stm32l0/src/bin/a.rs index f066c1139..dcc10e5c6 100644 --- a/examples/boot/application/stm32l0/src/bin/a.rs +++ b/examples/boot/application/stm32l0/src/bin/a.rs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | 3 | ||
| 4 | #[cfg(feature = "defmt-rtt")] | 4 | #[cfg(feature = "defmt")] |
| 5 | use defmt_rtt::*; | 5 | use defmt_rtt::*; |
| 6 | use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater, FirmwareUpdaterConfig}; | 6 | use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater, FirmwareUpdaterConfig}; |
| 7 | use embassy_embedded_hal::adapter::BlockingAsync; | 7 | use embassy_embedded_hal::adapter::BlockingAsync; |
diff --git a/examples/boot/application/stm32l0/src/bin/b.rs b/examples/boot/application/stm32l0/src/bin/b.rs index 6bf00f41a..a59c6f540 100644 --- a/examples/boot/application/stm32l0/src/bin/b.rs +++ b/examples/boot/application/stm32l0/src/bin/b.rs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | 3 | ||
| 4 | #[cfg(feature = "defmt-rtt")] | 4 | #[cfg(feature = "defmt")] |
| 5 | use defmt_rtt::*; | 5 | use defmt_rtt::*; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_stm32::gpio::{Level, Output, Speed}; | 7 | use embassy_stm32::gpio::{Level, Output, Speed}; |
diff --git a/examples/boot/application/stm32l1/Cargo.toml b/examples/boot/application/stm32l1/Cargo.toml index 3e964df9c..c07d71591 100644 --- a/examples/boot/application/stm32l1/Cargo.toml +++ b/examples/boot/application/stm32l1/Cargo.toml | |||
| @@ -23,6 +23,7 @@ cortex-m-rt = "0.7.0" | |||
| 23 | [features] | 23 | [features] |
| 24 | defmt = [ | 24 | defmt = [ |
| 25 | "dep:defmt", | 25 | "dep:defmt", |
| 26 | "dep:defmt-rtt", | ||
| 26 | "embassy-stm32/defmt", | 27 | "embassy-stm32/defmt", |
| 27 | "embassy-boot-stm32/defmt", | 28 | "embassy-boot-stm32/defmt", |
| 28 | "embassy-sync/defmt", | 29 | "embassy-sync/defmt", |
diff --git a/examples/boot/application/stm32l1/src/bin/a.rs b/examples/boot/application/stm32l1/src/bin/a.rs index f066c1139..dcc10e5c6 100644 --- a/examples/boot/application/stm32l1/src/bin/a.rs +++ b/examples/boot/application/stm32l1/src/bin/a.rs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | 3 | ||
| 4 | #[cfg(feature = "defmt-rtt")] | 4 | #[cfg(feature = "defmt")] |
| 5 | use defmt_rtt::*; | 5 | use defmt_rtt::*; |
| 6 | use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater, FirmwareUpdaterConfig}; | 6 | use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater, FirmwareUpdaterConfig}; |
| 7 | use embassy_embedded_hal::adapter::BlockingAsync; | 7 | use embassy_embedded_hal::adapter::BlockingAsync; |
diff --git a/examples/boot/application/stm32l1/src/bin/b.rs b/examples/boot/application/stm32l1/src/bin/b.rs index 6bf00f41a..a59c6f540 100644 --- a/examples/boot/application/stm32l1/src/bin/b.rs +++ b/examples/boot/application/stm32l1/src/bin/b.rs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | 3 | ||
| 4 | #[cfg(feature = "defmt-rtt")] | 4 | #[cfg(feature = "defmt")] |
| 5 | use defmt_rtt::*; | 5 | use defmt_rtt::*; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_stm32::gpio::{Level, Output, Speed}; | 7 | use embassy_stm32::gpio::{Level, Output, Speed}; |
diff --git a/examples/boot/application/stm32l4/Cargo.toml b/examples/boot/application/stm32l4/Cargo.toml index b154403ac..72b937ca7 100644 --- a/examples/boot/application/stm32l4/Cargo.toml +++ b/examples/boot/application/stm32l4/Cargo.toml | |||
| @@ -23,6 +23,7 @@ cortex-m-rt = "0.7.0" | |||
| 23 | [features] | 23 | [features] |
| 24 | defmt = [ | 24 | defmt = [ |
| 25 | "dep:defmt", | 25 | "dep:defmt", |
| 26 | "dep:defmt-rtt", | ||
| 26 | "embassy-stm32/defmt", | 27 | "embassy-stm32/defmt", |
| 27 | "embassy-boot-stm32/defmt", | 28 | "embassy-boot-stm32/defmt", |
| 28 | "embassy-sync/defmt", | 29 | "embassy-sync/defmt", |
diff --git a/examples/boot/application/stm32l4/src/bin/a.rs b/examples/boot/application/stm32l4/src/bin/a.rs index a0079ee33..7f8015c04 100644 --- a/examples/boot/application/stm32l4/src/bin/a.rs +++ b/examples/boot/application/stm32l4/src/bin/a.rs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | 3 | ||
| 4 | #[cfg(feature = "defmt-rtt")] | 4 | #[cfg(feature = "defmt")] |
| 5 | use defmt_rtt::*; | 5 | use defmt_rtt::*; |
| 6 | use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater, FirmwareUpdaterConfig}; | 6 | use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater, FirmwareUpdaterConfig}; |
| 7 | use embassy_embedded_hal::adapter::BlockingAsync; | 7 | use embassy_embedded_hal::adapter::BlockingAsync; |
diff --git a/examples/boot/application/stm32l4/src/bin/b.rs b/examples/boot/application/stm32l4/src/bin/b.rs index 22ba82d5e..b1a505631 100644 --- a/examples/boot/application/stm32l4/src/bin/b.rs +++ b/examples/boot/application/stm32l4/src/bin/b.rs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | 3 | ||
| 4 | #[cfg(feature = "defmt-rtt")] | 4 | #[cfg(feature = "defmt")] |
| 5 | use defmt_rtt::*; | 5 | use defmt_rtt::*; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_stm32::gpio::{Level, Output, Speed}; | 7 | use embassy_stm32::gpio::{Level, Output, Speed}; |
diff --git a/examples/boot/application/stm32wb-dfu/src/main.rs b/examples/boot/application/stm32wb-dfu/src/main.rs index 929d6802c..0ab99ff90 100644 --- a/examples/boot/application/stm32wb-dfu/src/main.rs +++ b/examples/boot/application/stm32wb-dfu/src/main.rs | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | use core::cell::RefCell; | 4 | use core::cell::RefCell; |
| 5 | 5 | ||
| 6 | #[cfg(feature = "defmt-rtt")] | 6 | #[cfg(feature = "defmt")] |
| 7 | use defmt_rtt::*; | 7 | use defmt_rtt::*; |
| 8 | use embassy_boot_stm32::{AlignedBuffer, BlockingFirmwareState, FirmwareUpdaterConfig}; | 8 | use embassy_boot_stm32::{AlignedBuffer, BlockingFirmwareState, FirmwareUpdaterConfig}; |
| 9 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
diff --git a/examples/boot/application/stm32wl/Cargo.toml b/examples/boot/application/stm32wl/Cargo.toml index 93ead617c..a5160b797 100644 --- a/examples/boot/application/stm32wl/Cargo.toml +++ b/examples/boot/application/stm32wl/Cargo.toml | |||
| @@ -23,6 +23,7 @@ cortex-m-rt = "0.7.0" | |||
| 23 | [features] | 23 | [features] |
| 24 | defmt = [ | 24 | defmt = [ |
| 25 | "dep:defmt", | 25 | "dep:defmt", |
| 26 | "dep:defmt-rtt", | ||
| 26 | "embassy-stm32/defmt", | 27 | "embassy-stm32/defmt", |
| 27 | "embassy-boot-stm32/defmt", | 28 | "embassy-boot-stm32/defmt", |
| 28 | "embassy-sync/defmt", | 29 | "embassy-sync/defmt", |
diff --git a/examples/boot/application/stm32wl/src/bin/a.rs b/examples/boot/application/stm32wl/src/bin/a.rs index 2fb16bdc4..9f4f0b238 100644 --- a/examples/boot/application/stm32wl/src/bin/a.rs +++ b/examples/boot/application/stm32wl/src/bin/a.rs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | 3 | ||
| 4 | #[cfg(feature = "defmt-rtt")] | 4 | #[cfg(feature = "defmt")] |
| 5 | use defmt_rtt::*; | 5 | use defmt_rtt::*; |
| 6 | use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater, FirmwareUpdaterConfig}; | 6 | use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater, FirmwareUpdaterConfig}; |
| 7 | use embassy_embedded_hal::adapter::BlockingAsync; | 7 | use embassy_embedded_hal::adapter::BlockingAsync; |
diff --git a/examples/boot/application/stm32wl/src/bin/b.rs b/examples/boot/application/stm32wl/src/bin/b.rs index 8dd15d8cd..e954d8b91 100644 --- a/examples/boot/application/stm32wl/src/bin/b.rs +++ b/examples/boot/application/stm32wl/src/bin/b.rs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | 3 | ||
| 4 | #[cfg(feature = "defmt-rtt")] | 4 | #[cfg(feature = "defmt")] |
| 5 | use defmt_rtt::*; | 5 | use defmt_rtt::*; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_stm32::gpio::{Level, Output, Speed}; | 7 | use embassy_stm32::gpio::{Level, Output, Speed}; |
diff --git a/examples/boot/bootloader/nrf/Cargo.toml b/examples/boot/bootloader/nrf/Cargo.toml index 980149bea..9d5d51a13 100644 --- a/examples/boot/bootloader/nrf/Cargo.toml +++ b/examples/boot/bootloader/nrf/Cargo.toml | |||
| @@ -19,13 +19,13 @@ cfg-if = "1.0.0" | |||
| 19 | [features] | 19 | [features] |
| 20 | defmt = [ | 20 | defmt = [ |
| 21 | "dep:defmt", | 21 | "dep:defmt", |
| 22 | "dep:defmt-rtt", | ||
| 22 | "embassy-boot-nrf/defmt", | 23 | "embassy-boot-nrf/defmt", |
| 23 | "embassy-nrf/defmt", | 24 | "embassy-nrf/defmt", |
| 24 | ] | 25 | ] |
| 25 | softdevice = [ | 26 | softdevice = [ |
| 26 | "embassy-boot-nrf/softdevice", | 27 | "embassy-boot-nrf/softdevice", |
| 27 | ] | 28 | ] |
| 28 | debug = ["defmt-rtt", "defmt"] | ||
| 29 | 29 | ||
| 30 | [profile.dev] | 30 | [profile.dev] |
| 31 | debug = 2 | 31 | debug = 2 |
diff --git a/examples/boot/bootloader/rp/Cargo.toml b/examples/boot/bootloader/rp/Cargo.toml index 7eec3df1b..c15c980ca 100644 --- a/examples/boot/bootloader/rp/Cargo.toml +++ b/examples/boot/bootloader/rp/Cargo.toml | |||
| @@ -23,10 +23,10 @@ cfg-if = "1.0.0" | |||
| 23 | [features] | 23 | [features] |
| 24 | defmt = [ | 24 | defmt = [ |
| 25 | "dep:defmt", | 25 | "dep:defmt", |
| 26 | "dep:defmt-rtt", | ||
| 26 | "embassy-boot-rp/defmt", | 27 | "embassy-boot-rp/defmt", |
| 27 | "embassy-rp/defmt", | 28 | "embassy-rp/defmt", |
| 28 | ] | 29 | ] |
| 29 | debug = ["defmt-rtt", "defmt"] | ||
| 30 | 30 | ||
| 31 | [profile.release] | 31 | [profile.release] |
| 32 | debug = true | 32 | debug = true |
diff --git a/examples/boot/bootloader/stm32-dual-bank/Cargo.toml b/examples/boot/bootloader/stm32-dual-bank/Cargo.toml index 55adf84d7..b91b05412 100644 --- a/examples/boot/bootloader/stm32-dual-bank/Cargo.toml +++ b/examples/boot/bootloader/stm32-dual-bank/Cargo.toml | |||
| @@ -22,8 +22,7 @@ embedded-storage-async = "0.4.0" | |||
| 22 | cfg-if = "1.0.0" | 22 | cfg-if = "1.0.0" |
| 23 | 23 | ||
| 24 | [features] | 24 | [features] |
| 25 | defmt = ["dep:defmt", "embassy-boot-stm32/defmt", "embassy-stm32/defmt"] | 25 | defmt = ["dep:defmt", "dep:defmt-rtt", "embassy-boot-stm32/defmt", "embassy-stm32/defmt"] |
| 26 | debug = ["defmt-rtt", "defmt"] | ||
| 27 | 26 | ||
| 28 | [profile.dev] | 27 | [profile.dev] |
| 29 | debug = 2 | 28 | debug = 2 |
diff --git a/examples/boot/bootloader/stm32/Cargo.toml b/examples/boot/bootloader/stm32/Cargo.toml index ef2b99404..541186949 100644 --- a/examples/boot/bootloader/stm32/Cargo.toml +++ b/examples/boot/bootloader/stm32/Cargo.toml | |||
| @@ -21,10 +21,10 @@ cfg-if = "1.0.0" | |||
| 21 | [features] | 21 | [features] |
| 22 | defmt = [ | 22 | defmt = [ |
| 23 | "dep:defmt", | 23 | "dep:defmt", |
| 24 | "dep:defmt-rtt", | ||
| 24 | "embassy-boot-stm32/defmt", | 25 | "embassy-boot-stm32/defmt", |
| 25 | "embassy-stm32/defmt", | 26 | "embassy-stm32/defmt", |
| 26 | ] | 27 | ] |
| 27 | debug = ["defmt-rtt", "defmt"] | ||
| 28 | 28 | ||
| 29 | [profile.dev] | 29 | [profile.dev] |
| 30 | debug = 2 | 30 | debug = 2 |
diff --git a/examples/boot/bootloader/stm32wb-dfu/Cargo.toml b/examples/boot/bootloader/stm32wb-dfu/Cargo.toml index 93b5d8b34..9950ed7b6 100644 --- a/examples/boot/bootloader/stm32wb-dfu/Cargo.toml +++ b/examples/boot/bootloader/stm32wb-dfu/Cargo.toml | |||
| @@ -24,12 +24,12 @@ embassy-futures = { version = "0.1.1", path = "../../../../embassy-futures" } | |||
| 24 | [features] | 24 | [features] |
| 25 | defmt = [ | 25 | defmt = [ |
| 26 | "dep:defmt", | 26 | "dep:defmt", |
| 27 | "dep:defmt-rtt", | ||
| 27 | "embassy-boot-stm32/defmt", | 28 | "embassy-boot-stm32/defmt", |
| 28 | "embassy-stm32/defmt", | 29 | "embassy-stm32/defmt", |
| 29 | "embassy-usb/defmt", | 30 | "embassy-usb/defmt", |
| 30 | "embassy-usb-dfu/defmt" | 31 | "embassy-usb-dfu/defmt" |
| 31 | ] | 32 | ] |
| 32 | debug = ["defmt-rtt", "defmt"] | ||
| 33 | 33 | ||
| 34 | [profile.dev] | 34 | [profile.dev] |
| 35 | debug = 2 | 35 | debug = 2 |
diff --git a/examples/rp/src/bin/zerocopy.rs b/examples/rp/src/bin/zerocopy.rs new file mode 100644 index 000000000..39f03c8e4 --- /dev/null +++ b/examples/rp/src/bin/zerocopy.rs | |||
| @@ -0,0 +1,94 @@ | |||
| 1 | //! This example shows how to use `zerocopy_channel` from `embassy_sync` for | ||
| 2 | //! sending large values between two tasks without copying. | ||
| 3 | //! The example also shows how to use the RP2040 ADC with DMA. | ||
| 4 | #![no_std] | ||
| 5 | #![no_main] | ||
| 6 | |||
| 7 | use core::sync::atomic::{AtomicU16, Ordering}; | ||
| 8 | |||
| 9 | use defmt::*; | ||
| 10 | use embassy_executor::Spawner; | ||
| 11 | use embassy_rp::adc::{self, Adc, Async, Config, InterruptHandler}; | ||
| 12 | use embassy_rp::bind_interrupts; | ||
| 13 | use embassy_rp::gpio::Pull; | ||
| 14 | use embassy_rp::peripherals::DMA_CH0; | ||
| 15 | use embassy_sync::blocking_mutex::raw::NoopRawMutex; | ||
| 16 | use embassy_sync::zerocopy_channel::{Channel, Receiver, Sender}; | ||
| 17 | use embassy_time::{Duration, Ticker, Timer}; | ||
| 18 | use static_cell::StaticCell; | ||
| 19 | use {defmt_rtt as _, panic_probe as _}; | ||
| 20 | |||
| 21 | type SampleBuffer = [u16; 512]; | ||
| 22 | |||
| 23 | bind_interrupts!(struct Irqs { | ||
| 24 | ADC_IRQ_FIFO => InterruptHandler; | ||
| 25 | }); | ||
| 26 | |||
| 27 | const BLOCK_SIZE: usize = 512; | ||
| 28 | const NUM_BLOCKS: usize = 2; | ||
| 29 | static MAX: AtomicU16 = AtomicU16::new(0); | ||
| 30 | |||
| 31 | struct AdcParts { | ||
| 32 | adc: Adc<'static, Async>, | ||
| 33 | pin: adc::Channel<'static>, | ||
| 34 | dma: DMA_CH0, | ||
| 35 | } | ||
| 36 | |||
| 37 | #[embassy_executor::main] | ||
| 38 | async fn main(spawner: Spawner) { | ||
| 39 | let p = embassy_rp::init(Default::default()); | ||
| 40 | info!("Here we go!"); | ||
| 41 | |||
| 42 | let adc_parts = AdcParts { | ||
| 43 | adc: Adc::new(p.ADC, Irqs, Config::default()), | ||
| 44 | pin: adc::Channel::new_pin(p.PIN_29, Pull::None), | ||
| 45 | dma: p.DMA_CH0, | ||
| 46 | }; | ||
| 47 | |||
| 48 | static BUF: StaticCell<[SampleBuffer; NUM_BLOCKS]> = StaticCell::new(); | ||
| 49 | let buf = BUF.init([[0; BLOCK_SIZE]; NUM_BLOCKS]); | ||
| 50 | |||
| 51 | static CHANNEL: StaticCell<Channel<'_, NoopRawMutex, SampleBuffer>> = StaticCell::new(); | ||
| 52 | let channel = CHANNEL.init(Channel::new(buf)); | ||
| 53 | let (sender, receiver) = channel.split(); | ||
| 54 | |||
| 55 | spawner.must_spawn(consumer(receiver)); | ||
| 56 | spawner.must_spawn(producer(sender, adc_parts)); | ||
| 57 | |||
| 58 | let mut ticker = Ticker::every(Duration::from_secs(1)); | ||
| 59 | loop { | ||
| 60 | ticker.next().await; | ||
| 61 | let max = MAX.load(Ordering::Relaxed); | ||
| 62 | info!("latest block's max value: {:?}", max); | ||
| 63 | } | ||
| 64 | } | ||
| 65 | |||
| 66 | #[embassy_executor::task] | ||
| 67 | async fn producer(mut sender: Sender<'static, NoopRawMutex, SampleBuffer>, mut adc: AdcParts) { | ||
| 68 | loop { | ||
| 69 | // Obtain a free buffer from the channel | ||
| 70 | let buf = sender.send().await; | ||
| 71 | |||
| 72 | // Fill it with data | ||
| 73 | adc.adc.read_many(&mut adc.pin, buf, 1, &mut adc.dma).await.unwrap(); | ||
| 74 | |||
| 75 | // Notify the channel that the buffer is now ready to be received | ||
| 76 | sender.send_done(); | ||
| 77 | } | ||
| 78 | } | ||
| 79 | |||
| 80 | #[embassy_executor::task] | ||
| 81 | async fn consumer(mut receiver: Receiver<'static, NoopRawMutex, SampleBuffer>) { | ||
| 82 | loop { | ||
| 83 | // Receive a buffer from the channel | ||
| 84 | let buf = receiver.receive().await; | ||
| 85 | |||
| 86 | // Simulate using the data, while the producer is filling up the next buffer | ||
| 87 | Timer::after_micros(1000).await; | ||
| 88 | let max = buf.iter().max().unwrap(); | ||
| 89 | MAX.store(*max, Ordering::Relaxed); | ||
| 90 | |||
| 91 | // Notify the channel that the buffer is now ready to be reused | ||
| 92 | receiver.receive_done(); | ||
| 93 | } | ||
| 94 | } | ||
diff --git a/examples/stm32f1/src/bin/input_capture.rs b/examples/stm32f1/src/bin/input_capture.rs new file mode 100644 index 000000000..5e2dab9e6 --- /dev/null +++ b/examples/stm32f1/src/bin/input_capture.rs | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | #![no_std] | ||
| 2 | #![no_main] | ||
| 3 | |||
| 4 | use defmt::*; | ||
| 5 | use embassy_executor::Spawner; | ||
| 6 | use embassy_stm32::gpio::{Level, Output, Pull, Speed}; | ||
| 7 | use embassy_stm32::time::khz; | ||
| 8 | use embassy_stm32::timer::input_capture::{CapturePin, InputCapture}; | ||
| 9 | use embassy_stm32::timer::{self, Channel}; | ||
| 10 | use embassy_stm32::{bind_interrupts, peripherals}; | ||
| 11 | use embassy_time::Timer; | ||
| 12 | use {defmt_rtt as _, panic_probe as _}; | ||
| 13 | |||
| 14 | /// Connect PA2 and PC13 with a 1k Ohm resistor | ||
| 15 | |||
| 16 | #[embassy_executor::task] | ||
| 17 | async fn blinky(led: peripherals::PC13) { | ||
| 18 | let mut led = Output::new(led, Level::High, Speed::Low); | ||
| 19 | |||
| 20 | loop { | ||
| 21 | info!("high"); | ||
| 22 | led.set_high(); | ||
| 23 | Timer::after_millis(300).await; | ||
| 24 | |||
| 25 | info!("low"); | ||
| 26 | led.set_low(); | ||
| 27 | Timer::after_millis(300).await; | ||
| 28 | } | ||
| 29 | } | ||
| 30 | |||
| 31 | bind_interrupts!(struct Irqs { | ||
| 32 | TIM2 => timer::CaptureCompareInterruptHandler<peripherals::TIM2>; | ||
| 33 | }); | ||
| 34 | |||
| 35 | #[embassy_executor::main] | ||
| 36 | async fn main(spawner: Spawner) { | ||
| 37 | let p = embassy_stm32::init(Default::default()); | ||
| 38 | info!("Hello World!"); | ||
| 39 | |||
| 40 | unwrap!(spawner.spawn(blinky(p.PC13))); | ||
| 41 | |||
| 42 | let ch3 = CapturePin::new_ch3(p.PA2, Pull::None); | ||
| 43 | let mut ic = InputCapture::new(p.TIM2, None, None, Some(ch3), None, Irqs, khz(1000), Default::default()); | ||
| 44 | |||
| 45 | loop { | ||
| 46 | info!("wait for rising edge"); | ||
| 47 | ic.wait_for_rising_edge(Channel::Ch3).await; | ||
| 48 | |||
| 49 | let capture_value = ic.get_capture_value(Channel::Ch3); | ||
| 50 | info!("new capture! {}", capture_value); | ||
| 51 | } | ||
| 52 | } | ||
diff --git a/examples/stm32f1/src/bin/pwm_input.rs b/examples/stm32f1/src/bin/pwm_input.rs new file mode 100644 index 000000000..f74853d4e --- /dev/null +++ b/examples/stm32f1/src/bin/pwm_input.rs | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | #![no_std] | ||
| 2 | #![no_main] | ||
| 3 | |||
| 4 | use defmt::*; | ||
| 5 | use embassy_executor::Spawner; | ||
| 6 | use embassy_stm32::gpio::{Level, Output, Pull, Speed}; | ||
| 7 | use embassy_stm32::time::khz; | ||
| 8 | use embassy_stm32::timer::pwm_input::PwmInput; | ||
| 9 | use embassy_stm32::{bind_interrupts, peripherals, timer}; | ||
| 10 | use embassy_time::Timer; | ||
| 11 | use {defmt_rtt as _, panic_probe as _}; | ||
| 12 | |||
| 13 | /// Connect PA0 and PC13 with a 1k Ohm resistor | ||
| 14 | |||
| 15 | #[embassy_executor::task] | ||
| 16 | async fn blinky(led: peripherals::PC13) { | ||
| 17 | let mut led = Output::new(led, Level::High, Speed::Low); | ||
| 18 | |||
| 19 | loop { | ||
| 20 | info!("high"); | ||
| 21 | led.set_high(); | ||
| 22 | Timer::after_millis(300).await; | ||
| 23 | |||
| 24 | info!("low"); | ||
| 25 | led.set_low(); | ||
| 26 | Timer::after_millis(300).await; | ||
| 27 | } | ||
| 28 | } | ||
| 29 | |||
| 30 | bind_interrupts!(struct Irqs { | ||
| 31 | TIM2 => timer::CaptureCompareInterruptHandler<peripherals::TIM2>; | ||
| 32 | }); | ||
| 33 | |||
| 34 | #[embassy_executor::main] | ||
| 35 | async fn main(spawner: Spawner) { | ||
| 36 | let p = embassy_stm32::init(Default::default()); | ||
| 37 | info!("Hello World!"); | ||
| 38 | |||
| 39 | unwrap!(spawner.spawn(blinky(p.PC13))); | ||
| 40 | |||
| 41 | let mut pwm_input = PwmInput::new(p.TIM2, p.PA0, Pull::None, khz(10)); | ||
| 42 | pwm_input.enable(); | ||
| 43 | |||
| 44 | loop { | ||
| 45 | Timer::after_millis(500).await; | ||
| 46 | let period = pwm_input.get_period_ticks(); | ||
| 47 | let width = pwm_input.get_width_ticks(); | ||
| 48 | let duty_cycle = pwm_input.get_duty_cycle(); | ||
| 49 | info!( | ||
| 50 | "period ticks: {} width ticks: {} duty cycle: {}", | ||
| 51 | period, width, duty_cycle | ||
| 52 | ); | ||
| 53 | } | ||
| 54 | } | ||
diff --git a/examples/stm32f4/src/bin/i2s_dma.rs b/examples/stm32f4/src/bin/i2s_dma.rs index 97a04b2aa..27b165f1b 100644 --- a/examples/stm32f4/src/bin/i2s_dma.rs +++ b/examples/stm32f4/src/bin/i2s_dma.rs | |||
| @@ -15,14 +15,13 @@ async fn main(_spawner: Spawner) { | |||
| 15 | let p = embassy_stm32::init(Default::default()); | 15 | let p = embassy_stm32::init(Default::default()); |
| 16 | info!("Hello World!"); | 16 | info!("Hello World!"); |
| 17 | 17 | ||
| 18 | let mut i2s = I2S::new( | 18 | let mut i2s = I2S::new_txonly( |
| 19 | p.SPI2, | 19 | p.SPI2, |
| 20 | p.PC3, // sd | 20 | p.PC3, // sd |
| 21 | p.PB12, // ws | 21 | p.PB12, // ws |
| 22 | p.PB10, // ck | 22 | p.PB10, // ck |
| 23 | p.PC6, // mck | 23 | p.PC6, // mck |
| 24 | p.DMA1_CH4, | 24 | p.DMA1_CH4, |
| 25 | p.DMA1_CH3, | ||
| 26 | Hertz(1_000_000), | 25 | Hertz(1_000_000), |
| 27 | Config::default(), | 26 | Config::default(), |
| 28 | ); | 27 | ); |
diff --git a/examples/stm32f4/src/bin/pwm_input.rs b/examples/stm32f4/src/bin/pwm_input.rs new file mode 100644 index 000000000..ce200549d --- /dev/null +++ b/examples/stm32f4/src/bin/pwm_input.rs | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | #![no_std] | ||
| 2 | #![no_main] | ||
| 3 | |||
| 4 | use defmt::*; | ||
| 5 | use embassy_executor::Spawner; | ||
| 6 | use embassy_stm32::gpio::{Level, Output, Pull, Speed}; | ||
| 7 | use embassy_stm32::time::khz; | ||
| 8 | use embassy_stm32::timer::pwm_input::PwmInput; | ||
| 9 | use embassy_stm32::{bind_interrupts, peripherals, timer}; | ||
| 10 | use embassy_time::Timer; | ||
| 11 | use {defmt_rtt as _, panic_probe as _}; | ||
| 12 | |||
| 13 | /// Connect PB2 and PA6 with a 1k Ohm resistor | ||
| 14 | |||
| 15 | #[embassy_executor::task] | ||
| 16 | async fn blinky(led: peripherals::PB2) { | ||
| 17 | let mut led = Output::new(led, Level::High, Speed::Low); | ||
| 18 | |||
| 19 | loop { | ||
| 20 | info!("high"); | ||
| 21 | led.set_high(); | ||
| 22 | Timer::after_millis(300).await; | ||
| 23 | |||
| 24 | info!("low"); | ||
| 25 | led.set_low(); | ||
| 26 | Timer::after_millis(300).await; | ||
| 27 | } | ||
| 28 | } | ||
| 29 | |||
| 30 | bind_interrupts!(struct Irqs { | ||
| 31 | TIM2 => timer::CaptureCompareInterruptHandler<peripherals::TIM2>; | ||
| 32 | }); | ||
| 33 | |||
| 34 | #[embassy_executor::main] | ||
| 35 | async fn main(spawner: Spawner) { | ||
| 36 | let p = embassy_stm32::init(Default::default()); | ||
| 37 | info!("Hello World!"); | ||
| 38 | |||
| 39 | unwrap!(spawner.spawn(blinky(p.PB2))); | ||
| 40 | |||
| 41 | let mut pwm_input = PwmInput::new(p.TIM3, p.PA6, Pull::None, khz(10)); | ||
| 42 | pwm_input.enable(); | ||
| 43 | |||
| 44 | loop { | ||
| 45 | Timer::after_millis(500).await; | ||
| 46 | let period = pwm_input.get_period_ticks(); | ||
| 47 | let width = pwm_input.get_width_ticks(); | ||
| 48 | let duty_cycle = pwm_input.get_duty_cycle(); | ||
| 49 | info!( | ||
| 50 | "period ticks: {} width ticks: {} duty cycle: {}", | ||
| 51 | period, width, duty_cycle | ||
| 52 | ); | ||
| 53 | } | ||
| 54 | } | ||
diff --git a/examples/stm32f4/src/bin/usb_ethernet.rs b/examples/stm32f4/src/bin/usb_ethernet.rs index 19ae16e8b..b398c35da 100644 --- a/examples/stm32f4/src/bin/usb_ethernet.rs +++ b/examples/stm32f4/src/bin/usb_ethernet.rs | |||
| @@ -43,7 +43,7 @@ bind_interrupts!(struct Irqs { | |||
| 43 | // If you are trying this and your USB device doesn't connect, the most | 43 | // If you are trying this and your USB device doesn't connect, the most |
| 44 | // common issues are the RCC config and vbus_detection | 44 | // common issues are the RCC config and vbus_detection |
| 45 | // | 45 | // |
| 46 | // See https://embassy.dev/book/dev/faq.html#_the_usb_examples_are_not_working_on_my_board_is_there_anything_else_i_need_to_configure | 46 | // See https://embassy.dev/book/#_the_usb_examples_are_not_working_on_my_board_is_there_anything_else_i_need_to_configure |
| 47 | // for more information. | 47 | // for more information. |
| 48 | #[embassy_executor::main] | 48 | #[embassy_executor::main] |
| 49 | async fn main(spawner: Spawner) { | 49 | async fn main(spawner: Spawner) { |
diff --git a/examples/stm32f4/src/bin/usb_hid_keyboard.rs b/examples/stm32f4/src/bin/usb_hid_keyboard.rs index 537ff63ea..1270995c4 100644 --- a/examples/stm32f4/src/bin/usb_hid_keyboard.rs +++ b/examples/stm32f4/src/bin/usb_hid_keyboard.rs | |||
| @@ -24,7 +24,7 @@ bind_interrupts!(struct Irqs { | |||
| 24 | // If you are trying this and your USB device doesn't connect, the most | 24 | // If you are trying this and your USB device doesn't connect, the most |
| 25 | // common issues are the RCC config and vbus_detection | 25 | // common issues are the RCC config and vbus_detection |
| 26 | // | 26 | // |
| 27 | // See https://embassy.dev/book/dev/faq.html#_the_usb_examples_are_not_working_on_my_board_is_there_anything_else_i_need_to_configure | 27 | // See https://embassy.dev/book/#_the_usb_examples_are_not_working_on_my_board_is_there_anything_else_i_need_to_configure |
| 28 | // for more information. | 28 | // for more information. |
| 29 | #[embassy_executor::main] | 29 | #[embassy_executor::main] |
| 30 | async fn main(_spawner: Spawner) { | 30 | async fn main(_spawner: Spawner) { |
diff --git a/examples/stm32f4/src/bin/usb_hid_mouse.rs b/examples/stm32f4/src/bin/usb_hid_mouse.rs index df4b7426c..45136f965 100644 --- a/examples/stm32f4/src/bin/usb_hid_mouse.rs +++ b/examples/stm32f4/src/bin/usb_hid_mouse.rs | |||
| @@ -21,7 +21,7 @@ bind_interrupts!(struct Irqs { | |||
| 21 | // If you are trying this and your USB device doesn't connect, the most | 21 | // If you are trying this and your USB device doesn't connect, the most |
| 22 | // common issues are the RCC config and vbus_detection | 22 | // common issues are the RCC config and vbus_detection |
| 23 | // | 23 | // |
| 24 | // See https://embassy.dev/book/dev/faq.html#_the_usb_examples_are_not_working_on_my_board_is_there_anything_else_i_need_to_configure | 24 | // See https://embassy.dev/book/#_the_usb_examples_are_not_working_on_my_board_is_there_anything_else_i_need_to_configure |
| 25 | // for more information. | 25 | // for more information. |
| 26 | #[embassy_executor::main] | 26 | #[embassy_executor::main] |
| 27 | async fn main(_spawner: Spawner) { | 27 | async fn main(_spawner: Spawner) { |
diff --git a/examples/stm32f4/src/bin/usb_raw.rs b/examples/stm32f4/src/bin/usb_raw.rs index 1452e7c5f..b2d706208 100644 --- a/examples/stm32f4/src/bin/usb_raw.rs +++ b/examples/stm32f4/src/bin/usb_raw.rs | |||
| @@ -72,7 +72,7 @@ bind_interrupts!(struct Irqs { | |||
| 72 | // If you are trying this and your USB device doesn't connect, the most | 72 | // If you are trying this and your USB device doesn't connect, the most |
| 73 | // common issues are the RCC config and vbus_detection | 73 | // common issues are the RCC config and vbus_detection |
| 74 | // | 74 | // |
| 75 | // See https://embassy.dev/book/dev/faq.html#_the_usb_examples_are_not_working_on_my_board_is_there_anything_else_i_need_to_configure | 75 | // See https://embassy.dev/book/#_the_usb_examples_are_not_working_on_my_board_is_there_anything_else_i_need_to_configure |
| 76 | // for more information. | 76 | // for more information. |
| 77 | #[embassy_executor::main] | 77 | #[embassy_executor::main] |
| 78 | async fn main(_spawner: Spawner) { | 78 | async fn main(_spawner: Spawner) { |
diff --git a/examples/stm32f4/src/bin/usb_serial.rs b/examples/stm32f4/src/bin/usb_serial.rs index b2bd390b6..328b5effe 100644 --- a/examples/stm32f4/src/bin/usb_serial.rs +++ b/examples/stm32f4/src/bin/usb_serial.rs | |||
| @@ -19,7 +19,7 @@ bind_interrupts!(struct Irqs { | |||
| 19 | // If you are trying this and your USB device doesn't connect, the most | 19 | // If you are trying this and your USB device doesn't connect, the most |
| 20 | // common issues are the RCC config and vbus_detection | 20 | // common issues are the RCC config and vbus_detection |
| 21 | // | 21 | // |
| 22 | // See https://embassy.dev/book/dev/faq.html#_the_usb_examples_are_not_working_on_my_board_is_there_anything_else_i_need_to_configure | 22 | // See https://embassy.dev/book/#_the_usb_examples_are_not_working_on_my_board_is_there_anything_else_i_need_to_configure |
| 23 | // for more information. | 23 | // for more information. |
| 24 | #[embassy_executor::main] | 24 | #[embassy_executor::main] |
| 25 | async fn main(_spawner: Spawner) { | 25 | async fn main(_spawner: Spawner) { |
diff --git a/examples/stm32f7/src/bin/can.rs b/examples/stm32f7/src/bin/can.rs index e32b4d3df..a82e335a9 100644 --- a/examples/stm32f7/src/bin/can.rs +++ b/examples/stm32f7/src/bin/can.rs | |||
| @@ -24,7 +24,7 @@ bind_interrupts!(struct Irqs { | |||
| 24 | }); | 24 | }); |
| 25 | 25 | ||
| 26 | #[embassy_executor::task] | 26 | #[embassy_executor::task] |
| 27 | pub async fn send_can_message(tx: &'static mut CanTx<'static, CAN3>) { | 27 | pub async fn send_can_message(tx: &'static mut CanTx<'static>) { |
| 28 | loop { | 28 | loop { |
| 29 | let frame = Frame::new_data(unwrap!(StandardId::new(0 as _)), &[0]).unwrap(); | 29 | let frame = Frame::new_data(unwrap!(StandardId::new(0 as _)), &[0]).unwrap(); |
| 30 | tx.write(&frame).await; | 30 | tx.write(&frame).await; |
| @@ -45,7 +45,7 @@ async fn main(spawner: Spawner) { | |||
| 45 | let rx_pin = Input::new(&mut p.PA15, Pull::Up); | 45 | let rx_pin = Input::new(&mut p.PA15, Pull::Up); |
| 46 | core::mem::forget(rx_pin); | 46 | core::mem::forget(rx_pin); |
| 47 | 47 | ||
| 48 | static CAN: StaticCell<Can<'static, CAN3>> = StaticCell::new(); | 48 | static CAN: StaticCell<Can<'static>> = StaticCell::new(); |
| 49 | let can = CAN.init(Can::new(p.CAN3, p.PA8, p.PA15, Irqs)); | 49 | let can = CAN.init(Can::new(p.CAN3, p.PA8, p.PA15, Irqs)); |
| 50 | can.modify_filters().enable_bank(0, Fifo::Fifo0, Mask32::accept_all()); | 50 | can.modify_filters().enable_bank(0, Fifo::Fifo0, Mask32::accept_all()); |
| 51 | 51 | ||
| @@ -62,7 +62,7 @@ async fn main(spawner: Spawner) { | |||
| 62 | 62 | ||
| 63 | let (tx, mut rx) = can.split(); | 63 | let (tx, mut rx) = can.split(); |
| 64 | 64 | ||
| 65 | static CAN_TX: StaticCell<CanTx<'static, CAN3>> = StaticCell::new(); | 65 | static CAN_TX: StaticCell<CanTx<'static>> = StaticCell::new(); |
| 66 | let tx = CAN_TX.init(tx); | 66 | let tx = CAN_TX.init(tx); |
| 67 | spawner.spawn(send_can_message(tx)).unwrap(); | 67 | spawner.spawn(send_can_message(tx)).unwrap(); |
| 68 | 68 | ||
diff --git a/examples/stm32f7/src/bin/usb_serial.rs b/examples/stm32f7/src/bin/usb_serial.rs index 0e5cc7c5c..1906b28ed 100644 --- a/examples/stm32f7/src/bin/usb_serial.rs +++ b/examples/stm32f7/src/bin/usb_serial.rs | |||
| @@ -19,7 +19,7 @@ bind_interrupts!(struct Irqs { | |||
| 19 | // If you are trying this and your USB device doesn't connect, the most | 19 | // If you are trying this and your USB device doesn't connect, the most |
| 20 | // common issues are the RCC config and vbus_detection | 20 | // common issues are the RCC config and vbus_detection |
| 21 | // | 21 | // |
| 22 | // See https://embassy.dev/book/dev/faq.html#_the_usb_examples_are_not_working_on_my_board_is_there_anything_else_i_need_to_configure | 22 | // See https://embassy.dev/book/#_the_usb_examples_are_not_working_on_my_board_is_there_anything_else_i_need_to_configure |
| 23 | // for more information. | 23 | // for more information. |
| 24 | #[embassy_executor::main] | 24 | #[embassy_executor::main] |
| 25 | async fn main(_spawner: Spawner) { | 25 | async fn main(_spawner: Spawner) { |
diff --git a/examples/stm32g0/src/bin/spi_neopixel.rs b/examples/stm32g0/src/bin/spi_neopixel.rs index 2deee271d..edcae74f7 100644 --- a/examples/stm32g0/src/bin/spi_neopixel.rs +++ b/examples/stm32g0/src/bin/spi_neopixel.rs | |||
| @@ -76,7 +76,7 @@ async fn main(_spawner: Spawner) { | |||
| 76 | 76 | ||
| 77 | let mut config = Config::default(); | 77 | let mut config = Config::default(); |
| 78 | config.frequency = Hertz(4_000_000); | 78 | config.frequency = Hertz(4_000_000); |
| 79 | let mut spi = Spi::new_txonly_nosck(p.SPI1, p.PB5, p.DMA1_CH3, config); | 79 | let mut spi = Spi::new_txonly(p.SPI1, p.PB3, p.PB5, p.DMA1_CH3, config); // SCK is unused. |
| 80 | 80 | ||
| 81 | let mut neopixels = Ws2812::new(); | 81 | let mut neopixels = Ws2812::new(); |
| 82 | 82 | ||
diff --git a/examples/stm32h7/src/bin/usb_serial.rs b/examples/stm32h7/src/bin/usb_serial.rs index 1c50fc1c8..65ae597d4 100644 --- a/examples/stm32h7/src/bin/usb_serial.rs +++ b/examples/stm32h7/src/bin/usb_serial.rs | |||
| @@ -18,7 +18,7 @@ bind_interrupts!(struct Irqs { | |||
| 18 | // If you are trying this and your USB device doesn't connect, the most | 18 | // If you are trying this and your USB device doesn't connect, the most |
| 19 | // common issues are the RCC config and vbus_detection | 19 | // common issues are the RCC config and vbus_detection |
| 20 | // | 20 | // |
| 21 | // See https://embassy.dev/book/dev/faq.html#_the_usb_examples_are_not_working_on_my_board_is_there_anything_else_i_need_to_configure | 21 | // See https://embassy.dev/book/#_the_usb_examples_are_not_working_on_my_board_is_there_anything_else_i_need_to_configure |
| 22 | // for more information. | 22 | // for more information. |
| 23 | #[embassy_executor::main] | 23 | #[embassy_executor::main] |
| 24 | async fn main(_spawner: Spawner) { | 24 | async fn main(_spawner: Spawner) { |
diff --git a/examples/stm32l4/src/bin/usb_serial.rs b/examples/stm32l4/src/bin/usb_serial.rs index ed9671d0f..c3b1211d8 100644 --- a/examples/stm32l4/src/bin/usb_serial.rs +++ b/examples/stm32l4/src/bin/usb_serial.rs | |||
| @@ -19,7 +19,7 @@ bind_interrupts!(struct Irqs { | |||
| 19 | // If you are trying this and your USB device doesn't connect, the most | 19 | // If you are trying this and your USB device doesn't connect, the most |
| 20 | // common issues are the RCC config and vbus_detection | 20 | // common issues are the RCC config and vbus_detection |
| 21 | // | 21 | // |
| 22 | // See https://embassy.dev/book/dev/faq.html#_the_usb_examples_are_not_working_on_my_board_is_there_anything_else_i_need_to_configure | 22 | // See https://embassy.dev/book/#_the_usb_examples_are_not_working_on_my_board_is_there_anything_else_i_need_to_configure |
| 23 | // for more information. | 23 | // for more information. |
| 24 | #[embassy_executor::main] | 24 | #[embassy_executor::main] |
| 25 | async fn main(_spawner: Spawner) { | 25 | async fn main(_spawner: Spawner) { |
