File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ stm32-usbd = { version = "0.7.0", optional = true }
20
20
fixed = { version = " 1.28.0" , optional = true }
21
21
embedded-io = " 0.6"
22
22
stm32-hrtim = { version = " 0.1.0" , optional = true }
23
- rand = { version = " 0.9" , default-features = false }
23
+ rand_core = { version = " 0.9" , default-features = false }
24
24
25
25
[dependencies .cortex-m ]
26
26
version = " 0.7.7"
@@ -73,6 +73,7 @@ bme680 = "0.6.0"
73
73
embedded-sdmmc = " 0.3.0"
74
74
usb-device = { version = " 0.3.2" , features = [" defmt" ] }
75
75
usbd-serial = " 0.2.2"
76
+ rand = { version = " 0.9" , default-features = false }
76
77
77
78
# TODO: Separate feature sets
78
79
[features ]
Original file line number Diff line number Diff line change 1
1
//! True Random Number Generator (TRNG)
2
2
3
- use rand :: TryRngCore ;
3
+ use rand_core :: TryRngCore ;
4
4
5
5
use crate :: { rcc:: Rcc , stm32:: RNG } ;
6
6
use core:: { fmt:: Formatter , marker:: PhantomData } ;
@@ -27,6 +27,17 @@ impl core::fmt::Display for RngError {
27
27
}
28
28
}
29
29
30
+ #[ cfg( feature = "defmt" ) ]
31
+ impl defmt:: Format for RngError {
32
+ fn format ( & self , fmt : defmt:: Formatter ) {
33
+ match self {
34
+ RngError :: NotReady => defmt:: write!( fmt, "RNG Not ready" ) ,
35
+ RngError :: SeedError => defmt:: write!( fmt, "RNG Seed error" ) ,
36
+ RngError :: ClockError => defmt:: write!( fmt, "RNG Clock error" ) ,
37
+ }
38
+ }
39
+ }
40
+
30
41
/// Extension trait for the RNG register block
31
42
pub trait RngExt {
32
43
fn constrain ( self , rcc : & mut Rcc ) -> Rng < Stopped > ;
You can’t perform that action at this time.
0 commit comments