diff options
Diffstat (limited to 'examples/rp235x/src/bin')
| -rw-r--r-- | examples/rp235x/src/bin/sharing.rs | 1 | ||||
| -rw-r--r-- | examples/rp235x/src/bin/trng.rs | 5 |
2 files changed, 2 insertions, 4 deletions
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; |
