File tree 3 files changed +30
-1
lines changed
3 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,10 @@ cortex-m = "0.5.4"
19
19
panic-abort = " 0.3.0"
20
20
panic-semihosting = " 0.4.0"
21
21
22
+ [dev-dependencies .rand ]
23
+ default-features = false
24
+ version = " 0.5.5"
25
+
22
26
[target .'cfg(not(target_os = "none"))' .dev-dependencies ]
23
27
compiletest_rs = " 0.3.14"
24
28
Original file line number Diff line number Diff line change @@ -20,11 +20,12 @@ main() {
20
20
minimal
21
21
override-exception
22
22
pre_init
23
+ rand
23
24
state
24
25
unsafe-default-handler
25
- unsafe-hard-fault
26
26
unsafe-entry
27
27
unsafe-exception
28
+ unsafe-hard-fault
28
29
)
29
30
local fail_examples=(
30
31
data_overflow
Original file line number Diff line number Diff line change
1
+ //! Use rand crate to ensure it's configured for no_std compatbility
2
+
3
+ #![ deny( warnings) ]
4
+ #![ no_main]
5
+ #![ no_std]
6
+
7
+ extern crate cortex_m_rt as rt;
8
+ use rt:: entry;
9
+
10
+ extern crate panic_semihosting;
11
+
12
+ extern crate rand;
13
+ use rand:: Rng ;
14
+ use rand:: SeedableRng ;
15
+
16
+ // the program entry point
17
+ #[ entry]
18
+ fn main ( ) -> ! {
19
+ let seed: [ u8 ; 32 ] = [ 0 ; 32 ] ;
20
+ let mut rng = rand:: ChaChaRng :: from_seed ( seed) ;
21
+ let _ = rng. gen :: < u32 > ( ) ;
22
+
23
+ loop { }
24
+ }
You can’t perform that action at this time.
0 commit comments