Add rand-core v0.9 support.

Co-Authored-By: Aurélien Jacobs <aurel@gnuage.org>
This commit is contained in:
Dario Nieuwenhuis
2025-05-18 20:32:48 +02:00
parent e8b1ea14c7
commit e4fc487644
63 changed files with 227 additions and 131 deletions

View File

@@ -20,7 +20,6 @@ embedded-hal-async = "1.0.0"
mimxrt600-fcb = "0.2.2"
panic-probe = { version = "0.3", features = ["print-defmt"] }
rand = { version = "0.8.5", default-features = false }
# cargo build/run
[profile.dev]

View File

@@ -7,7 +7,6 @@ use defmt::*;
use embassy_executor::Spawner;
use embassy_imxrt::rng::Rng;
use embassy_imxrt::{bind_interrupts, peripherals, rng};
use rand::RngCore;
use {defmt_rtt as _, panic_probe as _};
bind_interrupts!(struct Irqs {
@@ -29,10 +28,10 @@ async fn main(_spawner: Spawner) {
// RngCore interface
let mut random_bytes = [0; 16];
let random_u32 = rng.next_u32();
let random_u64 = rng.next_u64();
let random_u32 = rng.blocking_next_u32();
let random_u64 = rng.blocking_next_u64();
rng.fill_bytes(&mut random_bytes);
rng.blocking_fill_bytes(&mut random_bytes);
info!("random_u32 {}", random_u32);
info!("random_u64 {}", random_u64);