diff options
| author | Dario Nieuwenhuis <[email protected]> | 2025-05-18 20:51:57 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-05-18 20:51:57 +0200 |
| commit | 51d0252194cd69f73bade2aaeef3163f3cc7453f (patch) | |
| tree | cac023f3457123f2fbc7686f2f90414987eae264 /examples/rp235x | |
| parent | e8b1ea14c7fb151aa5e296ca8f9724f175bdeaef (diff) | |
| parent | e4fc48764491f8981e4a145a72e9b6e72df8c546 (diff) | |
Merge pull request #4217 from embassy-rs/rand09
Add rand-core v0.9 support.
Diffstat (limited to 'examples/rp235x')
| -rw-r--r-- | examples/rp235x/Cargo.toml | 1 | ||||
| -rw-r--r-- | examples/rp235x/src/bin/sharing.rs | 1 | ||||
| -rw-r--r-- | examples/rp235x/src/bin/trng.rs | 5 |
3 files changed, 2 insertions, 5 deletions
diff --git a/examples/rp235x/Cargo.toml b/examples/rp235x/Cargo.toml index 345a915af..a247bc619 100644 --- a/examples/rp235x/Cargo.toml +++ b/examples/rp235x/Cargo.toml | |||
| @@ -55,7 +55,6 @@ embedded-storage = { version = "0.3" } | |||
| 55 | static_cell = "2.1" | 55 | static_cell = "2.1" |
| 56 | portable-atomic = { version = "1.5", features = ["critical-section"] } | 56 | portable-atomic = { version = "1.5", features = ["critical-section"] } |
| 57 | log = "0.4" | 57 | log = "0.4" |
| 58 | rand = { version = "0.8.5", default-features = false } | ||
| 59 | embedded-sdmmc = "0.7.0" | 58 | embedded-sdmmc = "0.7.0" |
| 60 | 59 | ||
| 61 | [profile.release] | 60 | [profile.release] |
diff --git a/examples/rp235x/src/bin/sharing.rs b/examples/rp235x/src/bin/sharing.rs index 497c4f845..856be6ace 100644 --- a/examples/rp235x/src/bin/sharing.rs +++ b/examples/rp235x/src/bin/sharing.rs | |||
| @@ -27,7 +27,6 @@ use embassy_rp::{bind_interrupts, interrupt}; | |||
| 27 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; | 27 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; |
| 28 | use embassy_sync::{blocking_mutex, mutex}; | 28 | use embassy_sync::{blocking_mutex, mutex}; |
| 29 | use embassy_time::{Duration, Ticker}; | 29 | use embassy_time::{Duration, Ticker}; |
| 30 | use rand::RngCore; | ||
| 31 | use static_cell::{ConstStaticCell, StaticCell}; | 30 | use static_cell::{ConstStaticCell, StaticCell}; |
| 32 | use {defmt_rtt as _, panic_probe as _}; | 31 | use {defmt_rtt as _, panic_probe as _}; |
| 33 | 32 | ||
diff --git a/examples/rp235x/src/bin/trng.rs b/examples/rp235x/src/bin/trng.rs index ad19aef3e..100d6b104 100644 --- a/examples/rp235x/src/bin/trng.rs +++ b/examples/rp235x/src/bin/trng.rs | |||
| @@ -10,7 +10,6 @@ use embassy_rp::gpio::{Level, Output}; | |||
| 10 | use embassy_rp::peripherals::TRNG; | 10 | use embassy_rp::peripherals::TRNG; |
| 11 | use embassy_rp::trng::Trng; | 11 | use embassy_rp::trng::Trng; |
| 12 | use embassy_time::Timer; | 12 | use embassy_time::Timer; |
| 13 | use rand::RngCore; | ||
| 14 | use {defmt_rtt as _, panic_probe as _}; | 13 | use {defmt_rtt as _, panic_probe as _}; |
| 15 | 14 | ||
| 16 | bind_interrupts!(struct Irqs { | 15 | bind_interrupts!(struct Irqs { |
| @@ -33,8 +32,8 @@ async fn main(_spawner: Spawner) { | |||
| 33 | info!("Random bytes async {}", &randomness); | 32 | info!("Random bytes async {}", &randomness); |
| 34 | trng.blocking_fill_bytes(&mut randomness); | 33 | trng.blocking_fill_bytes(&mut randomness); |
| 35 | info!("Random bytes blocking {}", &randomness); | 34 | info!("Random bytes blocking {}", &randomness); |
| 36 | let random_u32 = trng.next_u32(); | 35 | let random_u32 = trng.blocking_next_u32(); |
| 37 | let random_u64 = trng.next_u64(); | 36 | let random_u64 = trng.blocking_next_u64(); |
| 38 | info!("Random u32 {} u64 {}", random_u32, random_u64); | 37 | info!("Random u32 {} u64 {}", random_u32, random_u64); |
| 39 | // Random number of blinks between 0 and 31 | 38 | // Random number of blinks between 0 and 31 |
| 40 | let blinks = random_u32 % 32; | 39 | let blinks = random_u32 % 32; |
