aboutsummaryrefslogtreecommitdiff
path: root/examples/rp235x
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2025-05-18 20:51:57 +0200
committerGitHub <[email protected]>2025-05-18 20:51:57 +0200
commit51d0252194cd69f73bade2aaeef3163f3cc7453f (patch)
treecac023f3457123f2fbc7686f2f90414987eae264 /examples/rp235x
parente8b1ea14c7fb151aa5e296ca8f9724f175bdeaef (diff)
parente4fc48764491f8981e4a145a72e9b6e72df8c546 (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.toml1
-rw-r--r--examples/rp235x/src/bin/sharing.rs1
-rw-r--r--examples/rp235x/src/bin/trng.rs5
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" }
55static_cell = "2.1" 55static_cell = "2.1"
56portable-atomic = { version = "1.5", features = ["critical-section"] } 56portable-atomic = { version = "1.5", features = ["critical-section"] }
57log = "0.4" 57log = "0.4"
58rand = { version = "0.8.5", default-features = false }
59embedded-sdmmc = "0.7.0" 58embedded-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};
27use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; 27use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex;
28use embassy_sync::{blocking_mutex, mutex}; 28use embassy_sync::{blocking_mutex, mutex};
29use embassy_time::{Duration, Ticker}; 29use embassy_time::{Duration, Ticker};
30use rand::RngCore;
31use static_cell::{ConstStaticCell, StaticCell}; 30use static_cell::{ConstStaticCell, StaticCell};
32use {defmt_rtt as _, panic_probe as _}; 31use {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};
10use embassy_rp::peripherals::TRNG; 10use embassy_rp::peripherals::TRNG;
11use embassy_rp::trng::Trng; 11use embassy_rp::trng::Trng;
12use embassy_time::Timer; 12use embassy_time::Timer;
13use rand::RngCore;
14use {defmt_rtt as _, panic_probe as _}; 13use {defmt_rtt as _, panic_probe as _};
15 14
16bind_interrupts!(struct Irqs { 15bind_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;